-
Notifications
You must be signed in to change notification settings - Fork 54
/
Dockerfile
38 lines (27 loc) · 874 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
38
FROM ruby:3.3.6-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 nodejs openssl-dev shared-mime-info libc6-compat \
&& rm -rf /var/cache/apk/* \
&& gem install bundler -v $(tail -n1 Gemfile.lock | xargs) \
&& bundle config set build.sassc "--disable-march-tune-native" \
&& 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"]