-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (30 loc) · 895 Bytes
/
Copy pathDockerfile
File metadata and controls
43 lines (30 loc) · 895 Bytes
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
# Multi-stage build for frontend with integrated nginx
FROM node:24-alpine AS builder
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci
# Copy source code
COPY . .
# Build the app
RUN npm run build
# Production stage with nginx
FROM nginx:alpine
# Install envsubst for runtime config injection
RUN apk add --no-cache gettext curl
# Copy built app
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy nginx configuration
COPY nginx.conf /etc/nginx/nginx.conf
# Copy runtime configuration script
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
# Copy config injection script
COPY inject-config.sh /inject-config.sh
RUN chmod +x /inject-config.sh
# Expose port 80 (nginx will serve on port 80)
EXPOSE 80
# Use our custom entrypoint
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]