-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (26 loc) · 817 Bytes
/
Dockerfile
File metadata and controls
37 lines (26 loc) · 817 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
# Build stage
FROM node:24-alpine3.21 AS builder
WORKDIR /app
# Install libc6-compat if needed
RUN apk add --no-cache libc6-compat
# Install dependencies
COPY package.json package-lock.json ./
RUN npm ci
# Build the Vite app
COPY . .
RUN npm run build
# Final stage: nginx serving dist/
FROM nginx:stable-alpine AS runner
# Remove default nginx website
RUN rm -rf /usr/share/nginx/html/*
# Copy custom nginx config
COPY nginx.conf /etc/nginx/nginx.conf
# Copy built Vite files
COPY --from=builder /app/dist /usr/share/nginx/html
# Healthcheck for nginx
HEALTHCHECK --interval=10s --timeout=5s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://0.0.0.0/health || exit 1
# Expose port 80 (standard HTTP)
EXPOSE 80
# Start nginx automatically
CMD ["nginx", "-g", "daemon off;"]