generated from spree/spree_starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.production
43 lines (32 loc) · 1.01 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
41
42
43
FROM ruby:2.7.4
RUN apt-get update -yq \
&& apt-get upgrade -yq \
#ESSENTIALS
&& apt-get install -y -qq --no-install-recommends build-essential curl git-core vim passwd unzip cron gcc wget netcat \
# RAILS PACKAGES NEEDED
&& apt-get update \
&& apt-get install -y --no-install-recommends imagemagick postgresql-client
# Clean cache and temp files, fix permissions
RUN apt-get clean -qy \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /app
WORKDIR /app
# install specific version of bundler
RUN gem install bundler -v 2.1.4
ENV BUNDLE_GEMFILE=/app/Gemfile \
BUNDLE_JOBS=20 \
BUNDLE_PATH=/bundle \
BUNDLE_BIN=/bundle/bin \
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 ["bash"]