Compose de prod pour Coolify : un seul service nginx sans port publie, compose de dev separe
This commit is contained in:
+9
-20
@@ -1,22 +1,11 @@
|
||||
# Production compose (what Coolify deploys): one service, the static site
|
||||
# built by the multi-stage Dockerfile and served by hardened nginx on 8080.
|
||||
# No host `ports:` mapping: the platform's reverse proxy (Traefik on
|
||||
# Coolify) routes straight to the exposed container port. For local
|
||||
# development use docker-compose.dev.yml instead.
|
||||
services:
|
||||
# live dev server with HMR on http://localhost:4321
|
||||
dev:
|
||||
image: node:22-alpine@sha256:16e22a550f3863206a3f701448c45f7912c6896a62de43add43bb9c86130c3e2
|
||||
working_dir: /app
|
||||
command: sh -c "corepack enable && pnpm install --frozen-lockfile && pnpm dev --host"
|
||||
ports:
|
||||
- '4321:4321'
|
||||
volumes:
|
||||
- .:/app
|
||||
- node_modules:/app/node_modules
|
||||
environment:
|
||||
- ASTRO_TELEMETRY_DISABLED=1
|
||||
|
||||
# production-like: the real nginx image with security headers on :8080
|
||||
preview:
|
||||
web:
|
||||
build: .
|
||||
ports:
|
||||
- '8080:8080'
|
||||
|
||||
volumes:
|
||||
node_modules:
|
||||
restart: unless-stopped
|
||||
expose:
|
||||
- '8080'
|
||||
|
||||
Reference in New Issue
Block a user