aleksa.sh/docker-compose.yaml
aleksa a9b8e7bc9e
All checks were successful
E2E Tests with Cypress / cypress (push) Successful in 3m12s
initial boilerplate code
2025-04-12 07:05:13 +02:00

41 lines
1,012 B
YAML

x-common: &common # shared values
build: &build-base
context: .
dockerfile: Dockerfile
ports: &ports
- '3000:3000'
healthcheck:
&healthcheck # curl outputs to /dev/null to prevent clutter in logs
test: ['CMD', 'curl', '-sf', 'http://localhost:3000', '-o', '/dev/null']
interval: 5s
timeout: 3s
retries: 1
start_period: 3s
services:
app-dev:
build:
<<: *build-base
target: dev
volumes:
- ./src:/app/src # enables hot reload
- /app/node_modules # keeps installed node_modules
ports: *ports
healthcheck: *healthcheck
app-prod: &app-prod
labels:
- 'production'
build:
<<: *build-base
target: prod
ports: *ports
healthcheck: *healthcheck
app-test:
<<: *app-prod
environment:
- NODE_ENV=test # override environment variables
ports:
- '3001:3000' # override ports to prevent conflicts while testing
healthcheck: *healthcheck # uses internal port 3000, not host 3001