-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.production
38 lines (27 loc) · 1.07 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
FROM ruby:2.6.5-alpine AS build-phase
ENV RAILS_ENV production
ENV BUNDLE_APP_CONFIG=/helpaneighbor/.bundle
RUN apk update \
&& apk upgrade \
&& apk add --update --no-cache \
build-base curl-dev git postgresql-dev \
yaml-dev zlib-dev nodejs yarn tzdata
WORKDIR /helpaneighbor
COPY Gemfile* package.json yarn.lock ./
RUN bundle config --local build.sassc --disable-march-tune-native
RUN bundle config --global frozen 1
RUN bundle install --path=vendor/bundle --without development test
RUN yarn install
COPY . .
RUN SECRET_KEY_BASE=`bin/rake secret` bin/rake assets:precompile
RUN rm -rf node_modules tmp/cache app/assets/images/* app/assets/fonts/* app/assets/stylesheets/* vendor/assets
####################################
FROM ruby:2.6.5-alpine
ENV RAILS_ENV production
ENV BUNDLE_APP_CONFIG=/helpaneighbor/.bundle
RUN apk update && apk upgrade && apk add --update --no-cache bash postgresql-dev nodejs tzdata
WORKDIR /helpaneighbor
COPY --from=build-phase /helpaneighbor /helpaneighbor
EXPOSE 3000
VOLUME /helpaneighbor/public
CMD ["/bin/sh", "/helpaneighbor/docker-entrypoint.sh"]