- Backend Dockerfile: added curl install for health check (not in aspnet base image) - Frontend Dockerfile: multi-stage Angular build with nginx serving - Frontend nginx.conf: SPA routing, API proxy, SignalR WebSocket support, health endpoint - Frontend .dockerignore: excludes node_modules, dist, .angular, etc. - docker-compose.dev.yml: added PostgreSQL service, fixed frontend context path, renamed web service from control-center-web to extrudex-web, added DB env vars, proper service dependencies with health checks - deploy.sh: updated service list to include PostgreSQL port
30 lines
889 B
Docker
30 lines
889 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
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
CMD wget -qO- http://localhost:80/health || exit 1
|
|
|
|
CMD ["nginx", "-g", "daemon off;"] |