-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathDockerfile
37 lines (26 loc) · 801 Bytes
/
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
FROM ruby:3.4.1-alpine
MAINTAINER Klaus Meyer <[email protected]>
ARG SOURCE_COMMIT
ENV SOURCE_COMMIT=$SOURCE_COMMIT
ENV PORT=8080
ENV SSL_PORT=8443
ENV SECRET_KEY_BASE=changeme
ENV RAILS_ENV=production
EXPOSE $PORT
EXPOSE $SSL_PORT
WORKDIR /app
ADD . .
RUN apk update \
&& apk add build-base zlib-dev tzdata openssl-dev shared-mime-info libc6-compat \
&& rm -rf /var/cache/apk/* \
&& gem install bundler -v $(tail -n1 Gemfile.lock | xargs) \
&& bundle config set without "development test" \
&& bundle install \
&& bundle exec rails assets:precompile \
&& addgroup -S app && adduser -S app -G app -h /app \
&& chown -R app:app /app \
&& chown -R app:app /usr/local/bundle
USER app
ADD docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["web"]