generated from NOAA-OWP/owp-open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
compose.yaml
executable file
·82 lines (79 loc) · 2.04 KB
/
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
services:
jupyterlab:
build:
context: .
dockerfile: Dockerfile.notebook
volumes:
- type: bind
source: ./notebooks
target: /app/notebooks
- type: bind
source: ./data
target: /app/data
- /var/run/docker.sock:/var/run/docker.sock
environment:
- PIKA_URL=rabbitmq
- RABBITMQ_HOST=rabbitmq
ports:
- "8888:8888"
command: jupyter-lab --NotebookApp.token='' --allow-root
user: root
app:
build:
context: .
dockerfile: Dockerfile.app
ports:
- "8000:8000"
environment:
- PIKA_URL=rabbitmq
- RABBITMQ_HOST=rabbitmq
- SQLALCHEMY_DATABASE_URL=postgresql://{}:{}@{}/{}
- REDIS_URL=redis
- DB_HOST=mock_db
- SUBSET_URL=http://hfsubset:8000/api/v1
- TROUTE_URL=http://troute:8000/api/v1
volumes:
- type: bind
source: ./data
target: /app/data
depends_on:
rabbitmq:
condition: service_healthy
command: sh -c ". /app/.venv/bin/activate && uvicorn src.rise.app.main:app --host 0.0.0.0 --port 8000"
healthcheck:
test: curl --fail -I http://localhost:8000/health || exit 1
interval: 90s
timeout: 5s
retries: 3
start_period: 5s
consumer:
build:
context: .
dockerfile: Dockerfile.app
restart: always
volumes:
- type: bind
source: ./data
target: /app/data
environment:
- PIKA_URL=rabbitmq
- RABBITMQ_HOST=rabbitmq
- SQLALCHEMY_DATABASE_URL=postgresql://{}:{}@{}/{}
- DB_HOST=mock_db
- REDIS_URL=redis
- SUBSET_URL=http://hfsubset:8000/api/v1
- TROUTE_URL=http://troute:8000/api/v1
command: sh -c ". /app/.venv/bin/activate && python src/rise/app/consumer_manager.py"
depends_on:
rabbitmq:
condition: service_healthy
rabbitmq:
image: rabbitmq:3.13-management
ports:
- "5672:5672"
- "15672:15672"
healthcheck:
test: [ "CMD", "rabbitmqctl", "status" ]
interval: 30s
timeout: 10s
retries: 5