Skip to content

Commit 3bba701

Browse files
author
Gor Saribekyan
committed
build fix
1 parent 8a12b44 commit 3bba701

2 files changed

Lines changed: 24 additions & 13 deletions

File tree

Dockerfile

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1-
FROM node:20.14.0
2-
3-
WORKDIR /app
1+
FROM node:20.19.0 AS base
2+
WORKDIR /app
43

5-
COPY package*.json ./
4+
FROM base AS deps
5+
COPY package.json yarn.lock ./
6+
RUN yarn install --frozen-lockfile
67

7-
RUN yarn install
8-
9-
COPY . .
10-
11-
RUN yarn run build:staging
12-
13-
EXPOSE 3005
14-
15-
CMD ["yarn", "run", "start:staging"]
8+
FROM base AS builder
9+
COPY --from=deps /app/node_modules ./node_modules
10+
COPY . .
11+
RUN yarn run build
1612

13+
FROM base AS runner
14+
ENV NODE_ENV=production
15+
WORKDIR /app
16+
COPY --from=builder /app/package.json ./package.json
17+
COPY --from=builder /app/next.config.js ./next.config.js
18+
COPY --from=builder /app/public ./public
19+
COPY --from=builder /app/.next ./.next
20+
COPY --from=builder /app/node_modules ./node_modules
21+
EXPOSE 3005
22+
CMD ["yarn", "run", "start:staging"]

docker-compose.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
services:
2+
web:
3+
build: .
4+
ports:
5+
- "3005:3005"

0 commit comments

Comments
 (0)