-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
92 lines (84 loc) · 2.31 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
version: '3.4'
services:
admin_app:
image: ldelelis/mockserver:develop
restart: always
command: gunicorn -w4 -b 0.0.0.0:8000 --chdir ./mockserver mockserver.wsgi
environment:
- IS_ADMIN_API=true
- DATABASE_URL=postgres://mockserver:changeme@db:5432/mocks-api
- DEBUG=True
volumes:
- .:/www
- static_volume:/usr/src/app/mockserver/static
depends_on:
- db
labels:
traefik.enable: "true"
traefik.frontend.passHostHeaders: "true"
traefik.http.services.admin_app.loadbalancer.server.port: "8000"
traefik.http.routers.admin_app.rule: Host(`localhost`)
mocks_app:
image: ldelelis/mockserver:develop
restart: always
command: gunicorn -w4 -b 0.0.0.0:8000 --chdir ./mockserver mockserver.wsgi
environment:
- DATABASE_URL=postgres://mockserver:changeme@db:5432/mocks-api
- DEBUG=True
volumes:
- .:/www
depends_on:
- db
labels:
traefik.enable: "true"
traefik.frontend.passHostHeaders: "true"
traefik.http.services.mocks_app.loadbalancer.server.port: "8000"
traefik.http.routers.mocks_app.rule: HostRegexp(`{org:[a-zA-Z0-9]+}.{proj:[a-zA-Z]+}.localhost`)
tasks:
image: ldelelis/mockserver:develop
restart: always
command: celery worker -A mockserver --workdir mockserver -l info
environment:
- CELERY_BROKER_URL=redis://cache:6379/1
- DEBUG=False
depends_on:
- cache
traefik:
image: traefik:v2.0
restart: always
ports:
- "8000:80"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
command:
- "--providers.docker"
depends_on:
- admin_app
- mocks_app
nginx:
image: nginx:latest
restart: always
volumes:
- ./conf:/etc/nginx/conf.d
- static_volume:/www/mockserver/static
depends_on:
- traefik
labels:
traefik.enable: "true"
traefik.frontend.passHostHeaders: "true"
traefik.http.routers.nginx.rule: Host(`localhost`) && PathPrefix(`/static`)
db:
image: postgres:12
restart: always
environment:
- POSTGRES_DB=mocks-api
- POSTGRES_USER=mockserver
- POSTGRES_PASSWORD=changeme
volumes:
- postgres:/var/lib/postgresql/data
cache:
image: redis:6
restart: always
volumes:
static_volume:
postgres: