-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
145 lines (136 loc) · 3.52 KB
/
docker-compose.yml
File metadata and controls
145 lines (136 loc) · 3.52 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: text.ur
services:
backend:
# image: ghcr.io/realdegrees/text.ur/backend:stable
build:
context: ./backend
dockerfile: Dockerfile
container_name: text.ur-backend
restart: always
env_file:
- .env
ports:
- "8000:8000"
volumes:
- logs:/annotation-software/logs
- storage_data:/annotation-software/storage
depends_on:
pgbouncer:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
interval: 30s
timeout: 10s
retries: 5
start_period: 40s
labels:
com.centurylinklabs.watchtower.scope: textur
frontend:
# image: ghcr.io/realdegrees/text.ur/frontend:stable
build:
context: ./frontend
dockerfile: Dockerfile
container_name: text.ur-frontend
restart: always
env_file:
- .env
environment:
- ADDRESS_HEADER=X-Forwarded-For
- XFF_DEPTH=1
ports:
- "3000:3000"
depends_on:
backend:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
labels:
com.centurylinklabs.watchtower.scope: textur
postgres:
image: postgres:16
container_name: text.ur-postgres
restart: always
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
volumes:
- postgres_data:/var/lib/postgresql/data
command:
- "postgres"
- "-c"
- "shared_buffers=512MB"
- "-c"
- "work_mem=16MB"
- "-c"
- "effective_cache_size=2GB"
- "-c"
- "max_connections=200"
- "-c"
- "log_min_duration_statement=500"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB} || exit 1"]
timeout: 10s
retries: 5
start_period: 30s
pgbouncer:
image: edoburu/pgbouncer:v1.24.1-p0
container_name: text.ur-pgbouncer
restart: always
environment:
DB_USER: ${POSTGRES_USER}
DB_PASSWORD: ${POSTGRES_PASSWORD}
DB_HOST: postgres
DB_NAME: ${POSTGRES_DB}
AUTH_TYPE: scram-sha-256
POOL_MODE: transaction
ADMIN_USERS: postgres,dbuser
DEFAULT_POOL_SIZE: 40
MAX_CLIENT_CONN: 1000
MIN_POOL_SIZE: 5
RESERVE_POOL_SIZE: 10
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ['CMD', 'pg_isready', '-h', 'localhost']
redis:
image: redis:8
container_name: text.ur-redis
restart: always
environment:
- REDIS_PASSWORD=${REDIS_PASSWORD}
command: ["redis-server", "--requirepass", "${REDIS_PASSWORD}"]
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD}", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
# Automatically restarts containers in the defined scope when a new image is available
watchtower:
image: docker.io/containrrr/watchtower
container_name: text.ur-watchtower
restart: always
command: --interval 30 --scope textur --cleanup
labels: [ "com.centurylinklabs.watchtower.scope=textur" ]
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- textur
volumes:
postgres_data:
storage_data:
redis_data:
logs:
networks:
textur:
driver: bridge