forked from chapterv/Tapnow-Studio-PP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.web
More file actions
38 lines (28 loc) · 1014 Bytes
/
Dockerfile.web
File metadata and controls
38 lines (28 loc) · 1014 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
# ============================================
# Tapnow Web Docker Image
# 前端静态页面容器(Nginx)
# ============================================
# ============================================
# Stage 1: 构建前端
# ============================================
FROM node:20-alpine AS frontend-builder
WORKDIR /app
# 安装依赖
COPY package*.json ./
RUN npm ci --production=false
# 复制源码并构建
COPY . .
RUN npm run build
# ============================================
# Stage 2: Nginx 运行时
# ============================================
FROM nginx:1.27-alpine
LABEL maintainer="Tapnow Studio"
LABEL description="Tapnow Web Static Server"
# 覆盖默认站点配置(含 SPA fallback)
COPY docker/nginx/default.conf /etc/nginx/conf.d/default.conf
# 复制构建产物
COPY --from=frontend-builder /app/dist/ /usr/share/nginx/html/
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD wget -q -O /dev/null http://localhost/ || exit 1