06488f0237
功能: - Go后端 (Gin + GORM + PostgreSQL) - UniApp用户端 (iOS/Android/小程序) - DaisyUI5后台管理 - JWT认证 + 微信登录 - 盲选加权算法 - 会员系统 + 优惠券 - 打分评价 + 偏好学习
25 lines
671 B
Docker
25 lines
671 B
Docker
FROM node:20-alpine AS builder
|
|
WORKDIR /app
|
|
COPY frontend-admin/package.json frontend-admin/package-lock.json* ./
|
|
RUN npm install --frozen-lockfile 2>/dev/null || npm install
|
|
COPY frontend-admin .
|
|
RUN npm run build
|
|
|
|
FROM nginx:alpine
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
# Proxy API requests to backend
|
|
RUN echo 'server { \
|
|
listen 80; \
|
|
location / { \
|
|
root /usr/share/nginx/html; \
|
|
try_files $uri $uri/ /index.html; \
|
|
} \
|
|
location /api/ { \
|
|
proxy_pass http://api:8080; \
|
|
proxy_set_header Host $host; \
|
|
proxy_set_header X-Real-IP $remote_addr; \
|
|
} \
|
|
}' > /etc/nginx/conf.d/default.conf
|
|
|
|
EXPOSE 80
|