-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
79 lines (73 loc) · 1.65 KB
/
docker-compose.yml
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
version: "3"
services:
app:
build:
context: .
dockerfile: Dockerfile
container_name: oh_my_nats_app
tty: true
deploy:
restart_policy:
condition: on-failure
max_attempts: 3
window: 20s
env_file:
- .env
networks:
- backend
depends_on:
- postgres
- redis
- nats-streaming
postgres:
image: postgres:alpine3.18
container_name: oh_my_nats_postgres
restart: always
env_file:
- .env
environment:
- POSTGRES_PASSWORD=${PG_PASS}
- POSTGRES_USER=${PG_USER}
- POSTGRES_DB=${PG_DB}
volumes:
- ./data/postgres:/var/lib/postgresql/data
expose:
- ${PG_PORT}
ports:
- ${PG_PORT}:${PG_PORT}
networks:
- backend
redis:
image: redis:7.0.9-alpine3.17
container_name: oh_my_nats_redis
env_file:
- .env
volumes:
- ./data/redis:/data
- ./config/redis/redis.conf:/usr/local/etc/redis/redis.conf
command: redis-server /usr/local/etc/redis/redis.conf --requirepass ${REDIS_PASS:?REDIS_PASS is not set} --maxmemory 64M --maxmemory-policy volatile-lru
ports:
- "6379:6379"
expose:
- 6379
networks:
- backend
nats-streaming:
image: nats-streaming:0.25-alpine3.18
container_name: oh_my_nats_streaming
restart: always
env_file:
- .env
volumes:
- ./data:/data
- ./config:/config
ports:
- "4222:4222"
- "8222:8222"
expose:
- 4222
- 8222
command: ["nats-streaming-server", "-user", "${NATS_USER}", "-pass", "${NATS_PASS}", "-cid", "${CLUSTER_ID}"]
networks:
backend:
driver: bridge