Files
psp_panel/Dockerfile
T
2026-05-04 20:02:10 +03:30

42 lines
726 B
Docker

# ---------- Build stage ----------
FROM node:20-alpine AS builder
ARG TENANT=tis
ARG DIST_DIR=tis
WORKDIR /app
RUN npm install -g pnpm
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
COPY . .
RUN if [ "$TENANT" = "default" ]; then \
pnpm run build; \
else \
pnpm run build:$TENANT; \
fi
# ---------- Runtime stage ----------
FROM nginx:alpine
# Remove default config
RUN rm -rf /etc/nginx/conf.d/*
# Copy optimized config
COPY nginx.conf /etc/nginx/conf.d/default.conf
ARG DIST_DIR=tis
COPY --from=builder /app/dist/${DIST_DIR}/browser /usr/share/nginx/html
# Optional: reduce image size
# RUN apk add --no-cache brotli
EXPOSE 8090
CMD ["nginx", "-g", "daemon off;"]