chore: add docker configuration

This commit is contained in:
s.esmaeili
2026-09-09 19:39:13 +03:30
parent 0ed6bed028
commit 78a68b3567
6 changed files with 201 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
FROM node:20-alpine AS alpine
RUN apk update
RUN apk add --no-cache libc6-compat
# Setup pnpm
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable pnpm
FROM alpine AS builder
WORKDIR /app
RUN pnpm i -g turbo
COPY . .
RUN turbo prune user-app --docker
FROM alpine AS installer
WORKDIR /app
# First install dependencies
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
RUN pnpm install
# Build the project
COPY --from=builder /app/out/full/ .
COPY turbo.json turbo.json
RUN pnpm turbo run build --filter=user-app...
FROM nginx:alpine AS runner
# Copy custom Nginx configuration
COPY nginx-spa.conf /etc/nginx/conf.d/default.conf
# Copy the built files from the installer stage
COPY --from=installer /app/apps/user-app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]