-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (28 loc) · 901 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
39
40
FROM ruby:2.5.3-alpine as builder
RUN apk add --no-cache --update \
bash \
build-base \
postgresql-client \
postgresql-dev \
nodejs \
yarn \
tzdata
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY Gemfile* /usr/src/app/
RUN bundle install --without development test
COPY . /usr/src/app
RUN rails assets:precompile RAILS_ENV=production SECRET_KEY_BASE=fake DATABASE_URL=fake
EXPOSE 3000
CMD ["rails", "server", "-b", "0.0.0.0"]
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--
FROM ruby:2.5.3-alpine
RUN apk add --no-cache --update \
postgresql-client \
tzdata
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY --from=builder /usr/local/bundle/ /usr/local/bundle/
COPY --from=builder /usr/src/app /usr/src/app
EXPOSE 3000
CMD ["rails", "server", "-b", "0.0.0.0"]