-
-
Notifications
You must be signed in to change notification settings - Fork 483
/
Dockerfile
43 lines (31 loc) · 933 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
FROM ruby:3.3.6-alpine AS builder
RUN apk update && apk upgrade && apk add --update --no-cache \
build-base \
curl-dev \
postgresql-dev \
tzdata
ARG RAILS_ROOT=/usr/src/app/
WORKDIR $RAILS_ROOT
COPY Gemfile* $RAILS_ROOT
RUN bundle install
### BUILD STEP DONE ###
FROM ruby:3.3.6-alpine
ARG RAILS_ROOT=/usr/src/app/
RUN apk update && apk upgrade && apk add --update --no-cache \
bash \
curl \
imagemagick \
postgresql-client \
tzdata \
vim && rm -rf /var/cache/apk/*
# The ruby alpine image's apk doesn't have the current version of node
RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main/ nodejs=22.11.0-r0 npm
WORKDIR $RAILS_ROOT
COPY . .
RUN npm install --global yarn
RUN yarn install
RUN yarn build && yarn build:css
COPY --from=builder /usr/local/bundle/ /usr/local/bundle/
EXPOSE 3000
ENTRYPOINT ["./docker-entrypoint.sh"]
CMD ["bin/rails", "s", "-b", "0.0.0.0"]