forked from Citric-Sheep/devtest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
52 lines (46 loc) · 1.08 KB
/
docker-compose.yml
File metadata and controls
52 lines (46 loc) · 1.08 KB
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
# yaml file to orquestrate the services of the system:
# DB - API - Simulation
version: "3.9"
services:
db:
image: postgres:14
container_name: elevator_db
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: elevator_sim
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
api:
build:
context: .
dockerfile: Dockerfile.api
container_name: elevator_api
restart: always
depends_on:
- db
environment:
DATABASE_URL: postgres://postgres:postgres@db:5432/elevator_sim
ports:
- "8000:8000"
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
volumes:
- .:/app
simulator:
build:
context: .
dockerfile: Dockerfile.sim
container_name: elevator_simulator
restart: "no" # does not run continously
depends_on:
- api
environment:
API_BASE_URL: http://api:8000
command: ["python", "runner.py"]
volumes:
- ./simulation_runner:/sim
volumes:
postgres_data: