Skip to content

Instantly share code, notes, and snippets.

@schmichri
Last active March 14, 2025 07:37
Show Gist options
  • Save schmichri/9679486f6bf41dee0cfdb0eaafe826da to your computer and use it in GitHub Desktop.
Save schmichri/9679486f6bf41dee0cfdb0eaafe826da to your computer and use it in GitHub Desktop.
2 stage Build of Angular site with SSR / Prerendering
# Stage 1 - Building the app
FROM node:lts as builder
ENV CI=true
WORKDIR /site
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build -- --configuration production --base-href="/"
# Stage 2 - creating a webserver with the app
FROM node:lts-alpine
RUN addgroup -S appuser && adduser -S appuser -G appuser
USER appuser
WORKDIR /app
COPY --from=builder /site/dist/license-token-website /app
CMD ["node","/app/server/server.mjs"]
@schmichri
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment