-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
42 lines (39 loc) · 995 Bytes
/
docker-compose.prod.yml
File metadata and controls
42 lines (39 loc) · 995 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Production Docker Swarm stack
# Usage: TAG=v1 docker stack deploy -c docker-compose.prod.yml myapp
services:
db:
image: postgres:16-alpine
environment:
POSTGRES_DB: app
POSTGRES_USER: app
POSTGRES_PASSWORD: apppassword
volumes:
- pgdata:/var/lib/postgresql/data
deploy:
placement:
constraints: [node.role == manager]
server:
build:
context: .
dockerfile: docker/Dockerfile.server
image: ${REGISTRY:-registry.local}/myapp-server:${TAG:-latest}
secrets:
- session_secret
entrypoint: ["/app/entrypoint.sh"]
command: ["node", "dist/index.js"]
environment:
DATABASE_URL: postgres://app:apppassword@db:5432/app
NODE_ENV: production
PORT: "3000"
deploy:
labels:
caddy: ${APP_DOMAIN:-myapp.jtlapp.net}
caddy.reverse_proxy: "{{upstreams 3000}}"
replicas: 2
depends_on:
- db
secrets:
session_secret:
external: true
volumes:
pgdata: