-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.frontend
More file actions
44 lines (30 loc) · 1.15 KB
/
Dockerfile.frontend
File metadata and controls
44 lines (30 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Multi-stage build for Angular frontend
FROM node:20-alpine AS build
# Set working directory
WORKDIR /app
# Copy package files
COPY AI.ProfilePhotoMaker.UI/package*.json ./
# Install dependencies (need dev dependencies for build)
RUN npm ci
# Copy source code
COPY AI.ProfilePhotoMaker.UI/ ./
# Allow overriding the Angular build target (defaults to production mvp-v1)
ARG ANGULAR_BUILD_SCRIPT=build:mvp-v1
# Build the Angular application using the selected script
RUN npm run ${ANGULAR_BUILD_SCRIPT}
# Production stage with nginx
FROM nginx:alpine
# Install curl for health checks
RUN apk add --no-cache curl
# Copy custom nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Copy built application from build stage (Angular CLI v19 outputs to browser/ subdirectory)
COPY --from=build /app/dist/ai.profile-photo-maker.ui/browser /usr/share/nginx/html
## Removed custom entrypoint script; use default nginx entrypoint
# Expose port 80
EXPOSE 80
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost/ || exit 1
# Start nginx with default entrypoint
CMD ["nginx", "-g", "daemon off;"]