forked from rubyforgood/casa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
48 lines (34 loc) · 913 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
FROM ruby:3.1.0-alpine AS builder
LABEL maintainer="[email protected]"
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/
WORKDIR $RAILS_ROOT
COPY package*.json yarn.lock $RAILS_ROOT
RUN yarn install --check-files
COPY Gemfile* $RAILS_ROOT
RUN bundle install
COPY . .
### BUILD STEP DONE ###
FROM ruby:3.1.0-alpine
ARG RAILS_ROOT=/usr/src/app/
RUN apk update && apk upgrade && apk add --update --no-cache \
bash \
imagemagick \
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"]