-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.production
40 lines (28 loc) · 1.02 KB
/
Dockerfile.production
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
FROM ruby:3.2.2-slim
RUN apt-get update -yq && apt-get upgrade -yq && apt-get install -y -qq --no-install-recommends \
build-essential gnupg2 git vim libpq-dev postgresql-client libvips42 imagemagick
# Clean cache and temp files, fix permissions
RUN apt-get clean -qy \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN mkdir /app
WORKDIR /app
RUN gem install bundler -v 2.4.1
ENV LANG=C.UTF-8 \
BUNDLE_GEMFILE=/app/Gemfile \
BUNDLE_JOBS=20 \
BUNDLE_PATH=/bundle \
BUNDLE_BIN=/bundle/bin \
BUNDLE_GITHUB__COM="${GITHUB_TOKEN}:x-oauth-basic" \
GEM_HOME=/bundle
ENV PATH="${BUNDLE_BIN}:${PATH}"
COPY Gemfile Gemfile.lock ./
RUN bundle install --binstubs --without development test
COPY . .
ENV RAILS_ENV production
ENV RAILS_SERVE_STATIC_FILES 1
ENV RAILS_LOG_TO_STDOUT 1
RUN SECRET_KEY_BASE=skb DB_ADAPTER=nulldb bundle exec rails assets:precompile
RUN chmod +x entrypoint.sh
ENTRYPOINT ["./entrypoint.sh"]
EXPOSE 3000
CMD ["bundle", "exec", "rails", "s", "-b", "0.0.0.0"]