-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.production.yaml
93 lines (91 loc) · 2.07 KB
/
docker-compose.production.yaml
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
# this version adds Redis (tile cache) and replicas (2x api, 2x downloader)
version: "3.3"
services:
redis:
image: "redis:alpine"
expose:
- "6379"
command: redis-server /usr/local/etc/redis/redis.conf
volumes:
- redis-data:/var/lib/redis
- ./redis-config/redis.conf:/usr/local/etc/redis/redis.conf
db:
image: "postgis/postgis:13-3.1-alpine"
platform: linux/x86_64
ports:
- "${DB_PORT:-5432}:${DB_PORT:-5432}"
environment:
- "PGPORT=${DB_PORT:-5432}"
- "POSTGRES_DB=$DB_NAME"
- "POSTGRES_PASSWORD=$DB_PASSWORD"
- "POSTGRES_USER=$DB_USER"
volumes:
- postgres-data:/var/lib/postgresql/data
- ./database:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD", "pg_isready", "-q", "-d", "${DB_NAME}", "-U", "${DB_USER}"]
interval: 10s
timeout: 5s
retries: 5
web-api:
build: ./web-api
env_file:
- .env
expose:
- "4000"
depends_on:
- db
- redis
deploy:
replicas: 4
restart: always
nginx:
image: nginx:latest
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- web-api
ports:
- "$NGINX_PORT:4000"
scheduler:
build:
# Scheduler needs context ., see the dockerfile
context: .
dockerfile: ./download_scheduler/Dockerfile
depends_on:
- db
deploy:
replicas: 2
env_file:
- .env
volumes:
- $DOWNLOADS_FOLDER:/usr/src/app/downloads
restart: always
frontend:
build:
context: ./frontend
args:
API_URL: $API_URL
expose:
- "80"
depends_on:
- web-api
harvester:
build:
context: .
dockerfile: ./harvester/Dockerfile
profiles:
- tools
depends_on:
- db
volumes:
- ./harvest_config.yaml:/usr/src/app/harvest_config.yaml
- ./harvester_cache:/usr/src/app/harvester_cache
- ./harvest:/usr/src/app/harvest
environment:
- "DB_HOST_EXTERNAL=$DB_HOST_EXTERNAL"
env_file:
- .env
volumes:
postgres-data:
redis-data: