-
Notifications
You must be signed in to change notification settings - Fork 6
/
docker-compose.yml
110 lines (100 loc) · 2.96 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
version: "3.9"
x-restart-policy: &restart_policy
restart: unless-stopped
x-project-defaults: &project_defaults
<<: *restart_policy
networks:
- annotation_nw
env_file: .env
services:
traefik:
<<: *project_defaults
image: ${TRAEFIK_IMAGE-traefik:v2.6}
depends_on:
frontend:
condition: service_healthy
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
api:
<<: *project_defaults
image: ${API_IMAGE-registry.gitlab.com/natural-solutions/geonature/annotation:api-dev}
build:
context: ../api
dockerfile: Dockerfile
target: development
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/openapi.json"]
interval: 10s
timeout: 5s
retries: 3
start_period: 20s
depends_on:
db:
condition: service_healthy
minio:
condition: service_healthy
labels:
- traefik.enable=true
- traefik.http.routers.api.rule=${TRAEFIK_ROUTER_RULE_API-PathPrefix(`/api/v1`)}
- traefik.http.routers.api.entrypoints=web
- traefik.http.routers.api.middlewares=api-stripprefix
- traefik.http.middlewares.api-stripprefix.stripprefix.prefixes=${API_ROOT_PATH-/api/v1}
frontend:
<<: *project_defaults
image: ${FRONTEND_IMAGE-registry.gitlab.com/natural-solutions/geonature/annotation:frontend-dev}
build:
context: ../frontend
dockerfile: Dockerfile
depends_on:
api:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
labels:
- traefik.enable=true
- traefik.http.routers.frontend.rule=${TRAEFIK_ROUTER_RULE_FRONTEND-PathPrefix(`/`)}
- traefik.http.routers.frontend.entrypoints=web
db:
<<: *project_defaults
image: postgres:14-alpine
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER-dbuser} -d ${DB_NAME-annotation} -h 127.0.0.1"]
interval: 10s
timeout: 5s
retries: 3
start_period: 60s
volumes:
- db_data:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD-dbpassword}
POSTGRES_DB: ${DB_NAME-annotation}
POSTGRES_USER: ${DB_USER-dbuser}
keycloak:
<<: *project_defaults
image: quay.io/keycloak/keycloak:18.0.2
command: start-dev
labels:
- traefik.enable=true
- traefik.http.routers.keycloak.rule=${TRAEFIK_ROUTER_RULE_KEYCLOAK-PathPrefix(`/auth`)}
- traefik.http.routers.keycloak.entrypoints=web
minio:
<<: *project_defaults
image: minio/minio
volumes:
- minio_data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
command: server --console-address :9001 /data
volumes:
db_data:
minio_data:
networks:
annotation_nw:
external: false