Files
Extrudex/frontend/Dockerfile
cubecraft-agents[bot] 1ee7562e81
Some checks failed
Dev Build / build-test (pull_request) Failing after 58s
Dev Build / deploy-dev (pull_request) Has been skipped
Dev Build / notify-success (pull_request) Has been skipped
Dev Build / notify-failure (pull_request) Successful in 4s
CUB-66: scaffold Angular frontend and add Dockerfile with nginx
- Scaffolded Angular 21 app in frontend/ (standalone, routing, scss)
- Multi-stage Dockerfile: node:22-alpine build → nginx:alpine serve
- nginx.conf with SPA routing fallback, API proxy, gzip, asset caching
- .dockerignore excludes node_modules, dist, .angular, spec files
- docker build → PASS, container serves UI on port 80 (HTTP 200)
- Final image: 92.9MB (nginx:alpine)
2026-04-26 20:10:01 +00:00

28 lines
631 B
Docker

# Stage 1: Build the Angular application
FROM node:22-alpine AS build
WORKDIR /app
# Copy package files first for better layer caching
COPY package.json package-lock.json ./
RUN npm ci
# Copy source and build
COPY . .
RUN npx ng build --configuration production
# Stage 2: Serve static files with nginx
FROM nginx:alpine
# Remove default nginx config
RUN rm /etc/nginx/conf.d/default.conf
# Copy custom nginx config
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Copy built Angular artifacts from build stage
COPY --from=build /app/dist/frontend/browser /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]