Skip to content

Commit d12f4f8

Browse files
committed
chore(deploy): limit prod
1 parent 468e3ab commit d12f4f8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

deploy/prod/docker-compose.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ services:
88
tags:
99
- "ttt:prod"
1010
container_name: ttt
11+
restart: always
1112
depends_on:
1213
postgres_master:
1314
condition: service_healthy
@@ -34,10 +35,12 @@ services:
3435
- postgres
3536
- redis
3637
command: ttt
38+
mem_limit: 200mb
3739

3840
redis:
3941
image: redis:8.0.2-bookworm
4042
container_name: ttt-redis
43+
restart: always
4144
volumes:
4245
- redis-data:/data
4346
- ./redis:/mnt/dev
@@ -51,6 +54,7 @@ services:
5154
command: [
5255
"redis-server", "/mnt/dev/redis.conf", "--requirepass", "$REDIS_PASSWORD"
5356
]
57+
mem_limit: 20mb
5458

5559
postgres_master:
5660
build:
@@ -59,6 +63,7 @@ services:
5963
tags:
6064
- "ttt_postgres_master:prod"
6165
container_name: ttt-postgres-master
66+
restart: always
6267
volumes:
6368
- postgres-master-data:/var/lib/postgresql/data
6469
networks:
@@ -69,6 +74,7 @@ services:
6974
POSTGRES_PASSWORD: ${POSTGRES_TTT_PASSWORD}
7075
POSTGRES_REPLICA_PASSWORD: ${POSTGRES_REPLICA_PASSWORD}
7176
command: ["-c", "config_file=/mnt/postgres.conf"]
77+
mem_limit: 30mb
7278
healthcheck:
7379
test: pg_isready -d ttt -U ttt
7480
start_period: 1m
@@ -85,6 +91,7 @@ services:
8591
POSTGRES_REPLICA_NAME: replica1
8692
POSTGRES_REPLICA_PASSWORD: ${POSTGRES_REPLICA_PASSWORD}
8793
container_name: ttt-postgres-replica1
94+
restart: always
8895
depends_on:
8996
postgres_master:
9097
condition: service_healthy
@@ -96,8 +103,8 @@ services:
96103
POSTGRES_DB: ttt
97104
POSTGRES_USER: ttt
98105
POSTGRES_PASSWORD: ${POSTGRES_TTT_PASSWORD}
99-
# user: postgres
100106
command: ["bash", "/mnt/start-server.sh"]
107+
mem_limit: 30mb
101108
healthcheck:
102109
test: pg_isready -d ttt -U ttt
103110
start_period: 1m

0 commit comments

Comments
 (0)