-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.prod
54 lines (40 loc) · 1.02 KB
/
Dockerfile.prod
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
48
49
50
51
52
53
54
FROM ruby:2.6-alpine as build
MAINTAINER Codecraft Team <[email protected]>
ENV LANG C.UTF-8
RUN apk add --no-cache \
build-base \
tzdata \
zlib-dev \
libxml2-dev \
libxslt-dev \
ca-certificates \
bash \
linux-headers \
postgresql-client \
postgresql-dev \
sqlite-dev \
nodejs \
yarn \
&& rm -rf /var/cache/apk/*
ENV LANG=C.UTF-8 \
BUNDLE_JOBS=4 \
BUNDLE_RETRY=3
ENV PATH /app/bin:$PATH
ENV RAILS_ENV=production
ENV NODE_ENV=production
ENV ASSETS_PRECOMPILE=1
ENV SECRET_KEY_BASE=1
RUN mkdir -p /app/config
WORKDIR /app
COPY Gemfile Gemfile.lock package.json yarn.lock ./
RUN gem update --system && \
gem install bundler io-console -N && \
bundle config build.nokogiri --use-system-libraries && \
bundle install
COPY . /app
RUN rails assets:precompile
# cleanup
RUN rm -rf node_modules tmp/cache vendor/assets test
EXPOSE 3000
ENTRYPOINT ["bundle", "exec"]
CMD ["rails", "server", "-b", "0.0.0.0"]