-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
43 lines (39 loc) · 973 Bytes
/
Copy pathdocker-compose.yml
File metadata and controls
43 lines (39 loc) · 973 Bytes
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
version: "3.9"
services:
db:
image: postgres:16
container_name: filmes_db
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: filmesdb
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init.sql:/docker-entrypoint-initdb.d/init.sql # cria tabela e insere dados
ports:
- "5432:5432"
api:
build: ./api
container_name: filmes_api
restart: always
environment:
DATABASE_URL: postgresql://postgres:postgres@db:5432/filmesdb
depends_on:
- db
ports:
- "8000:8000"
command: uvicorn main:app --host 0.0.0.0 --port 8000
dashboard:
build: ./dashboard
container_name: filmes_dashboard
restart: always
environment:
API_URL: http://api:8000
depends_on:
- api
ports:
- "8501:8501"
command: streamlit run app.py --server.port=8501 --server.address=0.0.0.0
volumes:
postgres_data: