-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (36 loc) · 999 Bytes
/
Copy pathDockerfile
File metadata and controls
39 lines (36 loc) · 999 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
# # Stage 1: build the Vue app
# FROM node:23-alpine AS builder
# WORKDIR /app
# COPY package*.json ./
# RUN npm ci
# COPY . .
# RUN npm run build
# # Stage 2: serve with nginx
# FROM nginx:stable-alpine
# # Remove default nginx website
# RUN rm -rf /usr/share/nginx/html/*
# # Copy built assets
# COPY --from=builder /app/dist /usr/share/nginx/html
# # Expose port
# EXPOSE 80
# # Use default nginx config; serve on 0.0.0.0:80
# CMD ["nginx", "-g", "daemon off;"]
# Stage 1: build the Vue app
FROM node:23-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# Stage 2: serve with nginx
FROM nginx:stable-alpine
# Remove default nginx website
RUN rm -rf /usr/share/nginx/html/*
# Copy built assets
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy custom nginx configuration with proxy settings
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port
EXPOSE 80
# Use default nginx config; serve on 0.0.0.0:80
CMD ["nginx", "-g", "daemon off;"]