-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
58 lines (56 loc) · 1.68 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
version: '3.8'
services:
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
image: brenoimatos/banca-frontend:latest
volumes:
- ./frontend:/app
- ./data/nginx:/etc/nginx/conf.d
- /app/node_modules
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
ports:
- 80:80
- 443:443
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
depends_on:
- backend
backend:
build:
context: ./backend
dockerfile: .devcontainer/Dockerfile
image: brenoimatos/banca-backend:latest
command: /bin/sh -c "alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 9000"
volumes:
- ./backend:/workspace:cached
environment:
- DATABASE_URL=${DATABASE_URL}
- PYTHONPATH=${PYTHONPATH}
- GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID}
- GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET}
- GOOGLE_STATE_SECRET=${GOOGLE_STATE_SECRET}
- USERS_SECRET_KEY=${USERS_SECRET_KEY}
- SENDGRID_API_KEY=${SENDGRID_API_KEY}
depends_on:
- db
db:
image: postgres:15-alpine
volumes:
- postgres_data:/var/lib/postgresql/data/
ports:
- "6543:5432"
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
certbot:
image: certbot/certbot
restart: unless-stopped
volumes:
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
volumes:
postgres_data: