Files
tehran_tala/apps/admin-panel/Dockerfile
T
2026-09-10 00:18:53 +03:30

36 lines
905 B
Docker

FROM node:20-bookworm AS base
# Setup pnpm — no apt/apk (build host often cannot reach package mirrors)
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable pnpm
FROM base AS builder
WORKDIR /app
RUN pnpm i -g turbo
COPY . .
RUN turbo prune admin-panel --docker
FROM base 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=admin-panel...
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/admin-panel/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]