From e6d6673d848230f02e3637519bf298cbe05c453e Mon Sep 17 00:00:00 2001 From: gitadmin Date: Wed, 22 Jul 2026 05:47:02 +0000 Subject: [PATCH] Add Dockerfile --- Dockerfile | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..c4055afc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +# ----- 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. +# Your angular.json defines the base output path as "preview" +COPY --from=build /app/preview ./preview + +# Expose the standard Angular SSR port +EXPOSE 4000 + +# Start the Node.js SSR server +# Note: Angular 17+ SSR usually outputs the server file to /server/server.mjs +CMD ["node", "preview/server/server.mjs"] \ No newline at end of file