-
-
Notifications
You must be signed in to change notification settings - Fork 522
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (38 loc) · 1.1 KB
/
Dockerfile
File metadata and controls
50 lines (38 loc) · 1.1 KB
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
ARG ROOT=/usr/src/app/
# available alpine packages: https://pkgs.alpinelinux.org/packages
FROM node:24-alpine AS node-source
FROM ruby:4.0.2-alpine AS build
ARG ROOT
WORKDIR $ROOT
RUN apk update && apk upgrade && apk add --update --no-cache \
build-base \
curl-dev \
libffi-dev \
yaml-dev \
linux-headers \
postgresql-dev \
tzdata
RUN bundle config set force_ruby_platform true
COPY Gemfile* $ROOT
RUN bundle install
FROM ruby:4.0.2-alpine
ARG ROOT
WORKDIR $ROOT
RUN apk update && apk upgrade && apk add --update --no-cache \
bash \
build-base \
curl \
imagemagick \
postgresql-client \
tzdata \
vim \
&& rm -rf /var/cache/apk/*
COPY . .
COPY --from=node-source /usr/local/bin/node /usr/local/bin/node
COPY --from=node-source /usr/local/lib/node_modules /usr/local/lib/node_modules
RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm
RUN npm ci
COPY --from=build /usr/local/bundle/ /usr/local/bundle/
EXPOSE 3000
ENTRYPOINT ["./docker-entrypoint.sh"]
CMD ["bin/rails", "s", "-b", "0.0.0.0"]