-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
79 lines (74 loc) · 2.05 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
services:
memcached:
image: memcached
restart: unless-stopped
db:
image: pgvector/pgvector:pg16
env_file:
- '.env'
volumes:
- ${APP_DATA_DIR?./app-data}/postgres-data:/var/lib/postgresql/data/
healthcheck:
test: pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}
interval: 30s
retries: 10
start_period: 10s
restart: unless-stopped
django:
image: backface/turtlenest:latest
build:
context: ./
dockerfile: Dockerfile
args:
DOCKER_BUILDKIT: 1
env_file:
- '.env'
depends_on:
- db
networks:
# - public_proxy
- default
healthcheck:
test: curl -o /dev/null localhost/alive|| true
interval: 10s
timeout: 10s
retries: 10
start_period: 20s
volumes:
- ${APP_DATA_DIR?./app-data/}/media:/app/app-data/media
- ./static:/app/static
ports:
- "8000:8000"
restart: unless-stopped
extra_hosts:
- "host.docker.internal:host-gateway"
db-backup:
image: pgvector/pgvector:pg16
env_file:
- '.env'
volumes:
- ${APP_DATA_DIR?./app-data}/postgres-backup:/backup
restart: unless-stopped
command: >
sh -c "while true; do \
echo $(date) 'starting database dump ${POSTGRES_DB} '; \
pg_dump postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB} -c > /backup/${POSTGRES_DB}-dump.sql.tmp; \
mv /backup/${POSTGRES_DB}-dump.sql.tmp /backup/${POSTGRES_DB}-dump.sql; \
echo $(date) 'finished dumping ${POSTGRES_DB} '; \
sleep 3600; \
done"
depends_on:
- db
legacy-db:
image: postgres:16
env_file:
- '.env'
volumes:
- ${APP_DATA_DIR?./app-data}/postgres-legacy-data:/var/lib/postgresql/data/
- ${APP_DATA_DIR?./app-data}/postgres-init:/docker-entrypoint-initdb.d/
healthcheck:
test: pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}
interval: 30s
retries: 10
start_period: 20s
restart: unless-stopped