-
Notifications
You must be signed in to change notification settings - Fork 6
/
docker-compose.yml
111 lines (104 loc) · 2.75 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
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
networks:
dtm-network:
name: dtm-network
volumes:
db-data:
name: drone-tm-db-data
frontend-html:
name: drone-tm-frontend-html
services:
backend:
build:
context: src/backend
dockerfile: Dockerfile
depends_on:
- db
- minio
ports:
- ${BACKEND_WEB_APP_PORT:-8000}:8000
volumes:
- ${PROJECT_DIR:-.}/src/backend:/project/src/backend
- frontend-html:/project/src/backend/frontend_html
env_file: .env
networks:
- dtm-network
restart: unless-stopped
frontend:
build:
context: src/frontend
dockerfile: Dockerfile
target: ${FRONTEND_TARGET_OVERRIDE:-development}
args:
BASE64_ARGS_TO_ENV: <USE FOR LIVE. Base64 encoded env variables>
ports:
- ${FRONTEND_WEB_APP_PORT:-3040}:3040
depends_on:
- minio
env_file: .env
networks:
- dtm-network
volumes:
- ${PROJECT_DIR:-.}/src/frontend:/app
- frontend-html:/tmp/frontend_html
# If error, please upgrade the db with `contrib/pg-upgrade/docker-compose.yml`
db:
image: postgis/postgis:16-3.4-alpine
volumes:
- db-data:/var/lib/postgresql/data
env_file: .env
environment:
LANG: en-GB.utf8
POSTGRES_INITDB_ARGS: "--locale-provider=icu --icu-locale=en-GB"
ports:
- "5467:5432"
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}"
command: server /export --console-address 0.0.0.0:9090 --address 0.0.0.0:9000
volumes:
- ${PROJECT_DIR:-.}/DockerData/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
restart: unless-stopped
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
restart: "no"
migrations:
build:
context: src/backend
dockerfile: Dockerfile
volumes:
- ${PROJECT_DIR:-.}/src/backend:/project/src/backend
depends_on:
- backend
- db
env_file:
- .env
networks:
- dtm-network
entrypoint: ["alembic", "upgrade", "head"]
restart: "no"