This repository was archived by the owner on Sep 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (37 loc) · 1.21 KB
/
Dockerfile
File metadata and controls
48 lines (37 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Based on https://github.com/standardnotes/syncing-server/blob/master/Dockerfile
FROM ruby:2-alpine
EXPOSE 3000
ENV PROJECT_REPO=https://github.com/standardnotes/syncing-server
ENV PROJECT_COMMIT=2a7abc3476b102cc349719c8e6a6cf7bac889399
ENV PROJECT_DIR=/src/
# Application settings.
ENV DB_HOST=standardnotes-db
ENV DB_DATABASE=standardnotes
ENV DB_USERNAME=standardnotes
ENV DB_PASSWORD=TO_BE_DEFINED
ENV DISABLE_USER_REGISTRATION=false
ENV RAILS_ENV=production
ENV RAILS_SERVE_STATIC_FILES=true
# Secret key should not include special characters:
ENV SECRET_KEY_BASE=TO_BE_DEFINED
# Build and test dependencies.
RUN apk add --update --no-cache \
git \
netcat-openbsd
# Application's dependencies.
RUN apk add --update --no-cache \
build-base \
mariadb-connector-c \
mariadb-dev \
nodejs \
tzdata \
zlib-dev
RUN git clone $PROJECT_REPO $PROJECT_DIR && \
cd $PROJECT_DIR && \
git checkout $PROJECT_COMMIT
WORKDIR $PROJECT_DIR
RUN gem install bundler:2.0.2
RUN bundle install
# See https://github.com/brianmario/mysql2/issues/1023
RUN mkdir ./lib/mariadb && ln -s /usr/lib/mariadb/plugin ./lib/mariadb/plugin
CMD "bundle exec rails db:migrate && bundle exec rails server -b 0.0.0.0"