-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
executable file
·100 lines (95 loc) · 2.95 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
services:
# validator-api service
api:
image: ignf/validator-api:master-dev
build:
context: .
dockerfile: .docker/Dockerfile
args:
- http_proxy
- https_proxy
environment:
- HTTP_PROXY=${HTTP_PROXY}
- HTTPS_PROXY=${HTTPS_PROXY}
# important for ogr2ogr...
- http_proxy=${HTTP_PROXY}
- https_proxy=${HTTPS_PROXY}
- APP_ENV=${APP_ENV}
- DB_CREATE=${DB_CREATE:-0}
- DB_UPGRADE=${DB_UPGRADE:-0}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@database:5432/validator_api?serverVersion=13&charset=utf8
- S3_ENDPOINT=${S3_ENDPOINT}
- S3_ACCESS_KEY=${S3_ACCESS_KEY}
- S3_SECRET_KEY=${S3_SECRET_KEY}
- S3_BUCKET=${S3_BUCKET}
networks:
- validator
volumes:
- api-data:/opt/validator-api/var/data
ports:
# local exposure when traefik is not available
- "8000:8000"
depends_on:
- database
labels:
- "traefik.enable=true"
- "traefik.http.routers.validator-api.rule=Host(`validator-api-v1.${HOST_HOSTNAME}`)"
- "traefik.http.services.validator-api-service.loadbalancer.server.port=8000"
restart: unless-stopped
database:
image: postgis/postgis:13-3.5-alpine
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
ports:
- 5432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -U validator"]
interval: 10s
timeout: 5s
retries: 5
networks:
- validator
volumes:
- db-data:/var/lib/postgresql/data/
restart: unless-stopped
#-----------------------------------------------------------------------
# Process validations
#-----------------------------------------------------------------------
worker:
image: ignf/validator-api:master-dev
command: [".docker/application.sh","backend"]
environment:
- HTTP_PROXY=${HTTP_PROXY}
- HTTPS_PROXY=${HTTPS_PROXY}
# important for ogr2ogr...
- http_proxy=${HTTP_PROXY}
- https_proxy=${HTTPS_PROXY}
- APP_ENV=${APP_ENV}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@database:5432/validator_api?serverVersion=15&charset=utf8
- S3_ENDPOINT=${S3_ENDPOINT}
- S3_ACCESS_KEY=${S3_ACCESS_KEY}
- S3_SECRET_KEY=${S3_SECRET_KEY}
- S3_BUCKET=${S3_BUCKET}
# validator-cli.jar only
- DB_URL=jdbc:postgresql://database:5432/validator_api
- DB_USER=${POSTGRES_USER}
- DB_PASSWORD=${POSTGRES_PASSWORD}
networks:
- validator
volumes:
- api-data:/opt/validator-api/var/data
depends_on:
- api
restart: unless-stopped
networks:
validator:
volumes:
# validations files
api-data:
# postgresql files (docker volume create db-data)
db-data: