-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
127 lines (116 loc) · 2.98 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
version: "3.8"
x-env: &env
environment:
DATABASE_URL: postgres://test_user:test_password@db_dev:5432/postgres_dev
REDIS_URL: redis://message_broker_store_dev
RABBITMQ_URL: pyamqp://guest@message_broker_dev//
FRONTEND_URL: http://localhost:8000
SECRET_KEY: super_secret
ENV: dev
env_file:
- backend/.env.local.dev
services:
backend:
<<: *env
build:
context: backend
dockerfile: Dockerfile.dev
volumes:
- ././backend:/home/user/app/
ports:
- 8001:8001
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
celery_worker:
<<: *env
build:
context: backend
dockerfile: Dockerfile.dev
volumes:
- ././backend:/home/user/app/
command: >
sh -c "pip install -e . &&
celery -A backend.celery.main worker -l INFO -E"
celery_beat:
<<: *env
build:
context: backend
dockerfile: Dockerfile.dev
volumes:
- ././backend:/home/user/app/
command: >
sh -c "pip install -e . &&
celery -A backend.celery.main beat"
fake_server:
<<: *env
build:
context: backend
dockerfile: Dockerfile.dev
volumes:
- ././backend:/home/user/app/
ports:
- 9000:9000
command: >
sh -c "python3 -m http.server -d ./tests/data 9000"
db_dev:
image: "postgres:10.15-alpine"
environment:
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_password
POSTGRES_DB: postgres_dev
volumes:
- pgdata_dev:/var/lib/postgresql/data:rw
ports:
- 8004:5432
healthcheck:
test: ["CMD", "pg_isready", "-U", "test_user", "-d", "postgres_dev"]
interval: 30s
timeout: 3s
retries: 30
start_period: 15s
message_broker_dev:
image: "rabbitmq:3.12.0-alpine"
ports:
- 8005:5672
message_broker_store_dev:
image: "redis:7.0.11-alpine"
ports:
- 8006:6379
frontend:
build:
context: frontend
dockerfile: Dockerfile.dev
working_dir: /home/node/app
volumes:
- ./frontend/tsconfig.json:/home/node/app/tsconfig.json
- ./frontend/src:/home/node/app/src
- ./frontend/public:/home/node/app/public
- ./frontend/package.json:/home/node/app/package.json
- ./frontend/package-lock.json:/home/node/app/package-lock.json
- node_modules_cache_frontend:/home/node/app/node_modules
environment:
PORT: 8000
REACT_APP_BACKEND_URL: http://localhost:8001
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/"]
interval: 30s
timeout: 5s
retries: 5
start_period: 15s
command: /bin/sh -c "npm install && npm start"
ports:
- 8000:8000
entrypoint:
image: "busybox:latest"
depends_on:
backend:
condition: service_healthy
frontend:
condition: service_healthy
volumes:
pgdata_dev:
node_modules_cache_frontend: