-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
95 lines (89 loc) · 2.45 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
version: "3.7"
services:
api:
build:
context: .
dockerfile: Dockerfile
args:
POETRY_DEV: ${POETRY_DEV:-true}
WAIT_BIN: ${WAIT_BIN:-wait}
env_file:
- env-api-dev
environment:
DEBUGPY: ${DEBUGPY:-false}
WAIT_HOSTS: rabbit:5672
WAIT_LOGGER_LEVEL: error
WAIT_TIMEOUT: 60
WAIT_SLEEP_INTERVAL: 5
PYDEVD_DISABLE_FILE_VALIDATION: 1
depends_on:
- rabbit
- traefik
volumes:
- ./src/:/app:cached
ports:
- 8000:80
- 5678:5678 # debupy for webapp
- 5679:5679 # debupy for console
command:
- /bin/sh
- -c
- |
/wait && bash -c \
'if [ "${DEBUGPY}" == "true" ]; then \
python -m debugpy --listen 0.0.0.0:5678 \
-m uvicorn app.asgi:app --host 0.0.0.0 --port 80 \
--reload --reload-dir /app --log-config logging.dev.yaml; \
else \
python -m uvicorn app.asgi:app --host 0.0.0.0 --port 80 \
--reload --reload-dir /app --log-config logging.dev.yaml; \
fi'
restart: on-failure
labels:
- "traefik.http.routers.api.rule=(Host(`app.localhost`) && PathPrefix(`/api`))"
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
WAIT_BIN: ${WAIT_BIN:-wait}
volumes:
- ./frontend/:/app:cached
# - /usr/app/node_modules
ports:
- 3000:3000
environment:
WAIT_HOSTS: api:8080
WAIT_LOGGER_LEVEL: error
WAIT_TIMEOUT: 60
WAIT_SLEEP_INTERVAL: 5
PYDEVD_DISABLE_FILE_VALIDATION: 1
depends_on:
- api
- traefik
labels:
- "traefik.http.routers.site.rule=Host(`app.localhost`)"
rabbit:
container_name: rabbit
image: rabbitmq:3.10.5-management-alpine
environment:
RABBITMQ_DEFAULT_USER: admin
RABBITMQ_DEFAULT_PASS: 1234
RABBITMQ_DEFAULT_VHOST: test
RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS: -rabbit log_levels [{connection,error}] -rabbitmq_management"
ports:
- 5672:5672 # AMQP protocol port
- 15672:15672 # HTTP management UI
volumes:
- rabbit_data:/var/lib/rabbitmq/mnesia:delegated # Persistent local volume
- ./rabbit.conf:/etc/rabbitmq/rabbitmq.conf # RabbitMQ configuration file
traefik:
image: traefik:v2.9
command: --api.insecure=true --providers.docker
ports:
- "80:80"
- "8081:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
volumes:
rabbit_data: