fix:deploy
This commit is contained in:
@@ -15,20 +15,16 @@ services:
|
|||||||
- db_data:/app/data
|
- db_data:/app/data
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
frontend:
|
# One-shot build container — not a running service.
|
||||||
|
# Run: docker compose run --rm frontend-builder
|
||||||
|
# Then copy dist/ to wherever nginx serves static files from.
|
||||||
|
frontend-builder:
|
||||||
build:
|
build:
|
||||||
context: ./frontend
|
context: ./frontend
|
||||||
args:
|
profiles:
|
||||||
# Baked into the Vite bundle at build time.
|
- build
|
||||||
# Compose reads this from the root .env file.
|
volumes:
|
||||||
VITE_API_URL: ${VITE_API_URL}
|
- ./frontend/dist:/app/dist
|
||||||
env_file:
|
|
||||||
- ./frontend/.env
|
|
||||||
ports:
|
|
||||||
- "4501:4501"
|
|
||||||
depends_on:
|
|
||||||
- backend
|
|
||||||
restart: unless-stopped
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
db_data:
|
db_data:
|
||||||
|
|||||||
@@ -12,17 +12,3 @@ COPY .env ./
|
|||||||
|
|
||||||
RUN bun install --frozen-lockfile
|
RUN bun install --frozen-lockfile
|
||||||
RUN bun run build
|
RUN bun run build
|
||||||
|
|
||||||
# ---- serve ----
|
|
||||||
FROM oven/bun:1-alpine
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY --from=builder /app/node_modules ./node_modules
|
|
||||||
COPY --from=builder /app/dist ./dist
|
|
||||||
COPY --from=builder /app/package.json ./
|
|
||||||
COPY --from=builder /app/vite.config.ts ./
|
|
||||||
|
|
||||||
EXPOSE 4501
|
|
||||||
|
|
||||||
CMD ["bun", "run", "node_modules/.bin/vite", "preview", "--host", "0.0.0.0", "--port", "4501"]
|
|
||||||
|
|||||||
Reference in New Issue
Block a user