-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
47 lines (38 loc) · 1.11 KB
/
Dockerfile
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
FROM ruby:2.3.4-alpine
ENV AUTHIFY_PORT=9292
ENV AUTHIFY_ENVIRONMENT=development
ENV AUTHIFY_DB_URL=sqlite3:///tmp/authify-api.db
ENV AUTHIFY_REDIS_HOST=redis
ENV AUTHIFY_PUBKEY_PATH=/ssl/public.pem
ENV AUTHIFY_PRIVKEY_PATH=/ssl/private.pem
ENV AUTHIFY_JWT_ISSUER="My Awesome Company Inc."
ENV AUTHIFY_JWT_ALGORITHM="ES512"
ENV AUTHIFY_JWT_EXPIRATION="15"
ENV AUTHIFY_VERIFICATIONS_REQUIRED="true"
RUN apk --no-cache upgrade \
&& apk --no-cache add \
git \
sqlite-libs mariadb-client mariadb-client-libs
RUN apk --no-cache add --virtual build-dependencies \
build-base \
ruby-dev \
sqlite-dev \
mariadb-dev
COPY . /app
RUN cd /app \
&& bundle install --jobs=4 \
&& apk del build-dependencies
RUN mkdir /ssl
RUN chown -R root:root /app \
&& chown nobody:nogroup /app/db \
&& chown nobody:nogroup /app/db/schema.rb \
&& rm -f /app/.travis.yml \
&& chown -R nobody:nogroup /ssl
USER nobody
WORKDIR /app
VOLUME /ssl
CMD bundle exec rake db:migrate \
&& bundle exec rackup \
-o 0.0.0.0 \
-p $AUTHIFY_PORT \
-E $AUTHIFY_ENVIRONMENT