fix: use docker compose watch under dev
All checks were successful
Deploy to Production / deploy (push) Successful in 1m12s

This commit is contained in:
魏风
2026-03-25 09:42:57 +08:00
parent 89c13e8cad
commit 4caf19fcc0
3 changed files with 44 additions and 4 deletions

View File

@@ -1,10 +1,9 @@
# Stage 0, "build-stage", based on Bun, to build and compile the frontend
FROM oven/bun:1 AS build-stage
# Shared Bun stage for frontend dependencies and sources
FROM oven/bun:1 AS bun-base
WORKDIR /app
COPY package.json bun.lock /app/
COPY frontend/package.json /app/frontend/
WORKDIR /app/frontend
@@ -14,10 +13,22 @@ RUN bun install
COPY ./frontend /app/frontend
ARG VITE_API_URL
# Development stage for docker compose watch + Vite HMR
FROM bun-base AS dev-stage
EXPOSE 80
CMD ["bun", "run", "dev", "--host", "0.0.0.0", "--port", "80"]
# Build stage for production assets
FROM bun-base AS build-stage
RUN bun run build
# Stage 1, based on Nginx, to have only the compiled app, ready for production with Nginx
# Production stage serving compiled assets with Nginx
FROM nginx:1
COPY --from=build-stage /app/frontend/dist/ /usr/share/nginx/html