forked from nycmeshnet/meshdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
102 lines (96 loc) · 2.42 KB
/
docker-compose.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
94
95
96
97
98
99
100
101
102
version: '3'
services:
postgres:
healthcheck:
test: pg_isready -U ${DB_USER}
interval: 5s
timeout: 3s
retries: 3
start_period: 5s
networks:
- api
ports:
- 5432:5432
image: docker.io/postgres:15-bookworm
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data/
redis:
healthcheck:
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
interval: 3s
timeout: 3s
retries: 3
start_period: 1s
networks:
- api
ports:
- 6379:6379
image:
redis
pelias:
networks:
- api
ports:
- 6800:3000
image: pelias/parser
meshdb:
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: curl http://127.0.0.1:8081/api/v1
interval: 3s
timeout: 3s
retries: 3
start_period: 4s
networks:
- api
env_file:
- .env
volumes:
- static_files:/opt/meshdb/static
image: willnilges/meshdb:main
build:
context: .
dockerfile: ./Dockerfile
nginx:
depends_on:
meshdb:
condition: service_healthy
networks:
- api
expose:
- 80
image: nginx
labels:
- "traefik.enable=true"
- "traefik.port=80"
# .nycmesh.net URL (with HTTPS)
- "traefik.http.routers.meshdb.rule=Host(`db.grandsvc.mesh.nycmesh.net`)"
- "traefik.http.routers.meshdb.entrypoints=websecure"
- "traefik.http.routers.meshdb.tls=true"
- "traefik.http.routers.meshdb.tls.certresolver=grandsvcresolver"
# .nycmesh.net Redirect insecure traffic
- "traefik.http.routers.meshdb-insecure.rule=Host(`db.grandsvc.mesh.nycmesh.net`)"
- "traefik.http.routers.meshdb-insecure.entrypoints=web"
- "traefik.http.middlewares.meshdb-https.redirectscheme.scheme=https"
- "traefik.http.routers.meshdb-insecure.middlewares=meshdb-https@docker"
# .mesh URL
- "traefik.http.routers.meshdb-mesh.rule=Host(`db.grandsvc.mesh`)"
- "traefik.http.routers.meshdb-mesh.entrypoints=web"
volumes:
- ./nginx:/etc/nginx/conf.d
- static_files:/var/www/html/static
volumes:
postgres_data:
static_files:
networks:
api:
external: $COMPOSE_EXTERNAL_NETWORK
name: $COMPOSE_NETWORK_NAME