-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.debug.yml
75 lines (68 loc) · 2.21 KB
/
docker-compose.debug.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
version: '3.4'
services:
# The purpose of 'init_upload_area' service is to create 'area' subfolder on the shared
# 'upload-storage' named volume with proper permissions (to grant write access for 'webapp'
# and 'worker' non-root services) [mainly for development]
# https://serverfault.com/questions/984578/change-permissions-for-named-volumes-in-docker
# (Option 2)
init_upload_area:
build:
context: .
dockerfile: Dockerfile-init-upload-area
volumes:
- upload-storage:/upload-storage
environment:
- UPLOAD_AREA=/upload-storage/area
webapp:
build: .
# command: ["sh", "-c", "pip install debugpy -t /tmp && python /tmp/debugpy --wait-for-client --listen 0.0.0.0:5678 -m flask run --no-debugger --no-reload --host 0.0.0.0 --port 5000"]
command: ["sh", "-c", "flask run --host 0.0.0.0 --port 5000"]
ports:
- 5000:5000
- 5678:5678
volumes:
- .:/usr/src/app
- upload-storage:/upload-storage
environment:
- LINDEP_SETTINGS=config.py
- FLASK_APP=server.application
- FLASK_ENV=development
- POSTGRES_CONN_STRING=host=db dbname=lindep user=postgres password=Rovei%Z3
- CELERY_BROKER_URL=amqp://user:PwWYF9dq@rabbitmq:5672//
- UPLOAD_AREA=/upload-storage/area
depends_on:
- rabbitmq
- db
worker:
build: .
command: celery --app=server.application.celapp worker -l INFO
volumes:
- .:/usr/src/app
- upload-storage:/upload-storage
environment:
- POSTGRES_CONN_STRING=host=db dbname=lindep user=postgres password=Rovei%Z3
- CELERY_BROKER_URL=amqp://user:PwWYF9dq@rabbitmq:5672//
- UPLOAD_AREA=/upload-storage/area
depends_on:
- webapp
- rabbitmq
- db
rabbitmq:
image: 'bitnami/rabbitmq:3.9' # in the absence of "build:" this option will pull the image
environment:
- RABBITMQ_USERNAME=user
- RABBITMQ_PASSWORD=PwWYF9dq
db:
build:
context: .
dockerfile: Dockerfile-db
environment:
POSTGRES_USER: postgres
POSTGRES_DB: postgres
POSTGRES_PASSWORD: Rovei%Z3
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- db:/var/lib/postgresql/data
volumes:
db:
upload-storage: