forked from rubyforgood/casa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
49 lines (34 loc) · 936 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
41
42
43
44
45
46
47
48
49
FROM ruby:2.7.1-alpine AS builder
LABEL maintainer="jeanine@littleforestconsulting.com"
RUN apk update && apk upgrade && apk add --update --no-cache \
build-base \
curl-dev \
nodejs \
postgresql-dev \
tzdata \
vim \
yarn && rm -rf /var/cache/apk/*
ARG RAILS_ROOT=/usr/src/app/
COPY Gemfile* $RAILS_ROOT
COPY package*.json $RAILS_ROOT
COPY yarn.lock $RAILS_ROOT
WORKDIR $RAILS_ROOT
RUN bundle config --global frozen 1 && bundle install
RUN yarn install
COPY . .
### BUILD STEP DONE ###
FROM ruby:2.7.1-alpine
ARG RAILS_ROOT=/usr/src/app/
RUN apk update && apk upgrade && apk add --update --no-cache \
bash \
nodejs \
postgresql-client \
tzdata \
vim \
yarn && rm -rf /var/cache/apk/*
WORKDIR $RAILS_ROOT
COPY --from=builder $RAILS_ROOT $RAILS_ROOT
COPY --from=builder /usr/local/bundle/ /usr/local/bundle/
EXPOSE 3000
ENTRYPOINT ["./docker-entrypoint.sh"]
CMD ["bin/rails", "s", "-b", "0.0.0.0"]