Files
syscom-master-admin-ui/docker/Dockerfile
T
2026-07-22 06:13:25 +00:00

29 lines
672 B
Docker

# ----- Stage 1: Build Angular SSR App -----
FROM node:22-alpine AS build
WORKDIR /app
# Copy package files
COPY package.json package-lock.json ./
# Install dependencies (cached if package files haven't changed)
RUN npm ci
# Copy the rest of the code (including the environment.ts injected by Gitea Actions)
COPY . .
# Build the Angular app for production
RUN npm run build
# ----- Stage 2: Serve SSR App -----
FROM node:22-alpine AS final
WORKDIR /app
# Copy the built assets from the build stage.
COPY --from=build /app/preview ./preview
# Expose the standard Angular SSR port
EXPOSE 4000
# Start the Node.js SSR server
CMD ["node", "preview/server/server.mjs"]