-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
77 lines (73 loc) · 1.94 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
services:
postgres:
image: postgres:15
ports:
- "5432:5432"
volumes:
- postgres_data_dev:/var/lib/postgresql/data
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
networks:
- app-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5
start_period: 10s
backend:
build:
context: ./backend
dockerfile: Dockerfile
# image: dellabeneta/python-peoples-crud-backend:latest
volumes:
- ./backend:/app:cached
- ./backend/tests:/app/tests:cached
ports:
- "8000:8000"
environment:
- PYTHONPATH=/app
- ENVIRONMENT=development
- DEBUG=1
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- JWT_SECRET_KEY=${JWT_SECRET_KEY}
- JWT_ALGORITHM=${JWT_ALGORITHM}
- JWT_ACCESS_TOKEN_EXPIRE_MINUTES=${JWT_ACCESS_TOKEN_EXPIRE_MINUTES}
- DATABASE_URL=${DATABASE_URL}
- BACKEND_CORS_ORIGINS=${BACKEND_CORS_ORIGINS}
# Novas variáveis do admin
- ADMIN_USERNAME=${ADMIN_USERNAME}
- ADMIN_PASSWORD=${ADMIN_PASSWORD}
- ADMIN_EMAIL=${ADMIN_EMAIL}
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
networks:
- app-network
depends_on:
postgres:
condition: service_healthy
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
# image: dellabeneta/python-peoples-crud-frontend:latest
ports:
- "5173:5173"
volumes:
- ./frontend:/app:cached
- /app/node_modules
environment:
- NODE_ENV=development
command: npm run dev -- --host 0.0.0.0
networks:
- app-network
depends_on:
- backend
networks:
app-network:
driver: bridge
volumes:
postgres_data_dev: