forked from rubyforgood/abalone
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
50 lines (37 loc) · 940 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
50
FROM ruby:3.0.2-alpine AS builder
ARG RAILS_ROOT=/usr/src/app/
WORKDIR $RAILS_ROOT
RUN apk add --update --no-cache \
build-base \
curl-dev \
nodejs \
postgresql-dev \
tzdata \
git \
yarn
COPY package*.json yarn.lock Gemfile* $RAILS_ROOT
RUN yarn install --check-files --frozen-lockfile &&\
bundle config --global frozen 1 && bundle install
### BUILD STEP DONE ###
FROM ruby:3.0.2-alpine
ARG RAILS_ROOT=/usr/src/app/
WORKDIR $RAILS_ROOT
RUN set -eux; \
addgroup -S app; \
adduser -S -D -G app -H -h $RAILS_ROOT -s /bin/sh app; \
chown -R app:app $RAILS_ROOT
RUN apk add --update --no-cache \
bash\
nodejs \
postgresql-client \
su-exec \
tzdata \
yarn \
&& rm -rf /var/cache/apk/*
COPY --from=builder $RAILS_ROOT $RAILS_ROOT
COPY --from=builder /usr/local/bundle/ /usr/local/bundle/
COPY . .
RUN chown -R app:app $RAILS_ROOT
EXPOSE 3000
ENTRYPOINT ["./docker-entrypoint.sh"]
CMD ["abalone"]