-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
102 lines (96 loc) · 2.71 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
102 lines (96 loc) · 2.71 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Development stack. Every port is published on loopback only: the database,
# cache and broker run with default credentials and must not face the network.
services:
api:
build:
context: .
dockerfile: Dockerfile.dev
env_file: .env.dev
ports:
- "127.0.0.1:3000:3000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
nats:
condition: service_healthy
restart: unless-stopped
networks:
- auth-net
- cache-net
- mail-net
- broker-net
postgres:
image: postgres:17-alpine@sha256:f02121de6f74d30d8a94cd1d9584125e2178d7e6c377d8130112d4e52d867995
environment:
POSTGRES_DB: auth_api
POSTGRES_USER: auth_api
POSTGRES_PASSWORD: auth_api
ports:
- "127.0.0.1:5432:5432"
volumes:
- postgres_dev_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U auth_api -d auth_api"]
interval: 5s
timeout: 5s
retries: 10
restart: unless-stopped
networks:
- auth-net
redis:
image: redis:7-alpine@sha256:520775a41a63e77e06c73e35d2fd9cc15921a609516818796b4ecbb813078bc7
ports:
- "127.0.0.1:6379:6379"
volumes:
- redis_dev_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 10
restart: unless-stopped
networks:
- cache-net
mailpit:
image: axllent/mailpit:v1.31@sha256:98b916bd3c8d61f7633a52d3ea2f58d00620cb01ca57ab59edde68c347a95365
ports:
- "127.0.0.1:1025:1025" # SMTP
- "127.0.0.1:8025:8025" # Web UI
restart: unless-stopped
networks:
- mail-net
nats:
image: nats:2-alpine@sha256:ac8f88a6494bffc2c2a5289a0ca61cb28a9145c11ba5677cf24265d07f46d8d4
# JetStream stores the user events the outbox relay publishes. Overriding
# the command drops the image's config file,
# so monitoring (probed by the healthcheck) is re-enabled explicitly.
command: ["--jetstream", "--store_dir", "/data", "--http_port", "8222"]
ports:
- "127.0.0.1:4222:4222" # client
- "127.0.0.1:8222:8222" # monitoring
tmpfs:
- /data
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:8222/healthz"]
interval: 5s
timeout: 5s
retries: 10
restart: unless-stopped
networks:
- broker-net
volumes:
postgres_dev_data:
redis_dev_data:
# All networks are compose-managed: the standalone deployment model (nginx in
# front, NATS in this file) needs no externally provisioned networks.
networks:
auth-net:
driver: bridge
cache-net:
driver: bridge
mail-net:
driver: bridge
broker-net:
driver: bridge