-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathDockerfile
65 lines (48 loc) · 1.26 KB
/
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
FROM ruby:3.1.6-alpine3.18 AS builder
LABEL maintainer="[email protected]"
RUN apk update && apk upgrade && apk add --update --no-cache \
build-base \
curl-dev \
git \
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 gems/ $RAILS_ROOT/gems
COPY Gemfile* $RAILS_ROOT
RUN bundle config --global frozen 1 && bundle install
COPY . .
### BUILD STEP DONE ###
FROM ruby:3.1.6-alpine3.18
ARG RAILS_ROOT=/usr/src/app/
RUN apk update && apk upgrade && apk add --update --no-cache \
bash \
gcompat \
imagemagick \
nodejs \
postgresql-client \
tzdata \
vim \
git \
openssl \
fontconfig \
libwebp \
yarn && rm -rf /var/cache/apk/*
RUN apk add --update --no-cache --virtual .ms-fonts msttcorefonts-installer && \
update-ms-fonts 2>/dev/null && \
fc-cache -f && \
apk del .ms-fonts
RUN yarn global add node-gyp
RUN yarn global add heroku
WORKDIR $RAILS_ROOT
COPY --from=builder $RAILS_ROOT $RAILS_ROOT
COPY --from=builder /usr/local/bundle/ /usr/local/bundle/
RUN rails assets:precompile
EXPOSE 3000
ENTRYPOINT ["./docker-entrypoint.sh"]
CMD ["bin/rails", "s", "-b", "0.0.0.0"]