-
Notifications
You must be signed in to change notification settings - Fork 6
/
docker-compose.vm.yml
104 lines (97 loc) · 2.45 KB
/
docker-compose.vm.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
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
networks:
dtm-network:
name: dtm-network
volumes:
db-data:
name: drone-tm-db-data-${GIT_BRANCH}
frontend-html:
name: drone-tm-frontend-html-${GIT_BRANCH}
minio-data:
name: drone-tm-minio-data-${GIT_BRANCH}
services:
backend:
image: ghcr.io/hotosm/drone-tm/backend:${GIT_BRANCH:-main}
restart: always
depends_on:
- db
- minio
volumes:
- frontend-html:/project/src/backend/frontend_html
ports:
- ${BACKEND_WEB_APP_PORT:-8000}:8000
env_file: .env
command:
[
"uvicorn",
"app.main:api",
"--host",
"0.0.0.0",
"--port",
"8000",
"--workers",
"${UVICORN_WORKERS:-4}",
"--log-level",
"${UVICORN_LOG_LEVEL:-info}",
]
networks:
- dtm-network
frontend:
image: ghcr.io/hotosm/drone-tm/frontend:${GIT_BRANCH:-main}
depends_on:
- minio
volumes:
- frontend-html:/tmp/frontend_html
env_file: .env
networks:
- dtm-network
db:
image: postgis/postgis:16-3.4-alpine
volumes:
- db-data:/var/lib/postgresql/data
env_file: .env
networks:
- dtm-network
restart: unless-stopped
healthcheck:
test: pg_isready -U ${POSTGRES_USER:-dtm} -d ${POSTGRES_DB:-dtm_db}
start_period: 5s
interval: 10s
timeout: 5s
retries: 3
minio:
image: "docker.io/minio/minio:${MINIO_TAG:-RELEASE.2024-08-03T04-33-23Z}"
restart: always
command: server /export --console-address 0.0.0.0:9090 --address 0.0.0.0:9000
volumes:
- minio-data:/export
environment:
MINIO_ROOT_USER: ${S3_ACCESS_KEY:-dtm_user}
MINIO_ROOT_PASSWORD: ${S3_SECRET_KEY:-somelongpassword}
env_file:
- .env
ports:
- 9000:9000
- 9090:9090
networks:
- dtm-network
createbuckets:
image: "docker.io/minio/minio:${MINIO_TAG:-RELEASE.2024-08-03T04-33-23Z}"
entrypoint: >
/bin/sh -c " mc config host add minio http://minio:9000 \$S3_ACCESS_KEY \$S3_SECRET_KEY; mc mb minio/\$S3_BUCKET_NAME; mc anonymous set download minio/\$S3_BUCKET_NAME/publicuploads/; exit 0; "
env_file:
- .env
depends_on:
- minio
networks:
- dtm-network
migrations:
image: ghcr.io/hotosm/drone-tm/backend:${GIT_BRANCH:-main}
depends_on:
- backend
- db
env_file:
- .env
networks:
- dtm-network
entrypoint: ["uv", "run", "alembic", "upgrade", "head"]
restart: "no"