feat: add docker ci pack

Signed-off-by: d0zingcat <iamtangli42@gmail.com>
This commit is contained in:
2026-01-13 21:22:45 +08:00
parent c0f383f281
commit 180f3cd825
11 changed files with 60 additions and 56 deletions

2
apps/web/.env.example Normal file
View File

@@ -0,0 +1,2 @@
# Backend API URL (for proxying)
VITE_API_URL=http://localhost:3000

View File

@@ -1,21 +0,0 @@
# Build stage
FROM oven/bun:1-alpine AS builder
WORKDIR /app
# Copy the entire project
COPY . .
# Install dependencies
RUN bun install --frozen-lockfile
# Build the web app
WORKDIR /app/apps/web
RUN bun run build
# Serve stage
FROM nginx:alpine
COPY --from=builder /app/apps/web/dist /usr/share/nginx/html
# Add a custom nginx config if needed to handle SPA routing, but for now default is okay
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

View File

@@ -3,7 +3,7 @@
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"dev": "bun run --env-file .env vite",
"build": "tsc && vite build",
"preview": "vite preview"
},

View File

@@ -13,11 +13,11 @@ export default defineConfig({
server: {
proxy: {
'/api': {
target: 'http://localhost:3000',
target: process.env.VITE_API_URL || 'http://localhost:3000',
changeOrigin: true,
},
'/webhook': {
target: 'http://localhost:3000',
target: process.env.VITE_API_URL || 'http://localhost:3000',
changeOrigin: true,
}
}