@@ -16,14 +16,14 @@ services:
1616 redis :
1717 condition : service_healthy
1818 environment :
19- TTT_POSTGRES_URL : postgresql+psycopg://ttt:${POSTGRES_MASTER_TTT_PASSWORD }@postgres_master:5432/ttt
19+ TTT_POSTGRES_URL : postgresql+psycopg://ttt:${POSTGRES_TTT_PASSWORD }@postgres_master:5432/ttt
2020 TTT_POSTGRES_POOL_SIZE : 8
2121 TTT_POSTGRES_POOL_TIMEOUT_SECONDS : 45
2222 TTT_POSTGRES_POOL_RECYCLE_SECONDS : 1800
2323 TTT_POSTGRES_POOL_PRE_PING : false
2424 TTT_POSTGRES_ECHO : true
2525
26- TTT_REDIS_URL : redis://${REDIS_PASSWORD}@redis:6379/0
26+ TTT_REDIS_URL : redis://: ${REDIS_PASSWORD}@redis:6379/0
2727 TTT_REDIS_POOL_SIZE : 16
2828
2929 TTT_GAME_WAITING_QUEUE_PULLING_TIMEOUT_MIN_MS : 100
@@ -34,14 +34,18 @@ services:
3434 - postgres
3535 - redis
3636 command : ttt
37+ # healthcheck:
38+ # test: ["true"]
39+ # start_period: 1m
40+ # start_interval: 30s
41+ # interval: 10s
3742
3843 redis :
3944 image : redis:8.0.2-bookworm
4045 container_name : ttt-redis
4146 volumes :
4247 - redis-data:/data
4348 - ./redis:/mnt/dev
44- - ../common/redis:/mnt/common
4549 networks :
4650 - redis
4751 healthcheck :
@@ -54,53 +58,53 @@ services:
5458 ]
5559
5660 postgres_master :
57- image : postgres:16.3-alpine3.19
61+ build :
62+ context : ../../
63+ dockerfile : deploy/prod/postgres_master/Dockerfile
64+ tags :
65+ - " ttt_postgres_master:prod"
5866 container_name : ttt-postgres-master
5967 volumes :
60- - ./postgres_master/postgres.conf:/mnt/postgres.conf
61- - ./postgres/common-postgres.conf:/mnt/common-postgres.conf
62- - ./postgres_master/init.sql:/docker-entrypoint-initdb.d/init.sql
6368 - postgres-master-data:/var/lib/postgresql/data
6469 networks :
6570 - postgres
6671 environment :
67- POSTGRES_MASTER_REPLICA_PASSWORD : ${POSTGRES_MASTER_REPLICA_PASSWORD}
68- POSTGRES_MASTER_TTT_PASSWORD : ${POSTGRES_MASTER_TTT_PASSWORD}
69- POSTGRES_DB : root
70- POSTGRES_USER : root
71- POSTGRES_PASSWORD : root
72- command : ["postgres", "-c", "config_file=/mnt/postgres.conf"]
72+ POSTGRES_DB : ttt
73+ POSTGRES_USER : ttt
74+ POSTGRES_PASSWORD : ${POSTGRES_TTT_PASSWORD}
75+ POSTGRES_REPLICA_PASSWORD : ${POSTGRES_REPLICA_PASSWORD}
76+ command : ["-c", "config_file=/mnt/postgres.conf"]
7377 healthcheck :
74- test : pg_isready -d postgres -U root
78+ test : pg_isready -d ttt -U ttt
7579 start_period : 1m
7680 start_interval : 1s
7781 interval : 5s
7882
7983 postgres_replica1 :
80- image : postgres:16.3-alpine3.19
84+ build :
85+ context : ../../
86+ dockerfile : deploy/prod/postgres_replica/Dockerfile
87+ tags :
88+ - " ttt_postgres_replica1:prod"
89+ args :
90+ POSTGRES_REPLICA_NAME : replica1
91+ POSTGRES_REPLICA_PASSWORD : ${POSTGRES_REPLICA_PASSWORD}
8192 container_name : ttt-postgres-replica1
8293 depends_on :
8394 postgres_master :
8495 condition : service_healthy
8596 volumes :
86- - ./postgres_replica/postgres.conf:/mnt/postgres.conf
87- - ./postgres/common-postgres.conf:/mnt/common-postgres.conf
8897 - postgres-replica1-data:/var/lib/postgresql/data
8998 networks :
9099 - postgres
91100 environment :
92- POSTGRES_DB : root
93- POSTGRES_USER : root
94- POSTGRES_PASSWORD : root
95- command : [
96- " postgres" ,
97- " -c" ,
98- " config_file=/mnt/postgres.conf" ,
99- " -c" ,
100- " primary_conninfo='host=postgres_master user=replica password=${POSTGRES_MASTER_REPLICA_PASSWORD} application_name=replica1\' " ,
101- ]
101+ POSTGRES_DB : ttt
102+ POSTGRES_USER : ttt
103+ POSTGRES_PASSWORD : ${POSTGRES_TTT_PASSWORD}
104+ # user: postgres
105+ command : ["bash", "/mnt/start-server.sh"]
102106 healthcheck :
103- test : pg_isready -d postgres -U root
107+ test : pg_isready -d ttt -U ttt
104108 start_period : 1m
105109 start_interval : 1s
106110 interval : 5s
0 commit comments