-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
50 lines (32 loc) · 900 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.3.0-alpine AS builder
WORKDIR /app
RUN apk add --no-cache \
curl \
build-base \
libpq-dev \
nodejs \
npm \
git
RUN npm install -g corepack \
&& corepack enable \
&& corepack prepare yarn@stable --activate
COPY Gemfile Gemfile.lock ./
RUN bundle config set deployment true
RUN bundle config set clean true
RUN bundle config set without "development test"
RUN bundle install --jobs $(nproc) --retry 3
COPY . .
RUN yarn install --frozen-lockfile
RUN yarn build:css:production
FROM ruby:3.3.0-alpine
WORKDIR /app
RUN apk add --no-cache \
curl \
libpq-dev
RUN bundle config set deployment true
RUN bundle config set without development test
COPY --from=builder /app/web/public/css/application.css /app/web/public/css/application.css
COPY --from=builder /app/vendor/bundle /app/vendor/bundle
COPY . .
EXPOSE 5000
CMD ["bin/entrypoint"]