2022-04-28 12:15:05 +08:00
|
|
|
# Builder
|
2023-07-23 13:38:32 +03:00
|
|
|
FROM node:18-alpine as builder
|
2022-04-28 12:15:05 +08:00
|
|
|
WORKDIR /src
|
2023-09-17 01:35:44 +05:30
|
|
|
|
|
|
|
# Cache dependencies first
|
2023-12-24 13:59:30 +03:00
|
|
|
COPY package.json pnpm-lock.yaml ./
|
|
|
|
RUN pnpm install
|
2023-09-17 01:35:44 +05:30
|
|
|
|
|
|
|
# Copy other files and build
|
2023-03-08 11:43:38 +03:00
|
|
|
COPY . /src/
|
2023-12-24 13:59:30 +03:00
|
|
|
RUN pnpm build
|
2022-04-28 12:15:05 +08:00
|
|
|
|
|
|
|
# App
|
2022-08-16 17:23:13 +03:00
|
|
|
FROM nginxinc/nginx-unprivileged
|
2023-03-08 11:43:38 +03:00
|
|
|
COPY --chown=nginx:nginx --from=builder /src/out /app
|
2022-08-16 17:23:13 +03:00
|
|
|
COPY default.conf /etc/nginx/conf.d/default.conf
|