-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-local.yaml
62 lines (62 loc) · 1.88 KB
/
docker-compose-local.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
version: "3.9"
services:
backend:
container_name: fastapi-uvicorn-backend
build:
context: ./services/backend
dockerfile: Dockerfile
depends_on:
- db
command: |
bash -c 'while !</dev/tcp/db/5432; do sleep 1; done; uvicorn app.main:app --reload --workers 1 --host 0.0.0.0 --port ${PORT:-8000}'
# bash -c 'while !</dev/tcp/db/5432; do sleep 1; done; gunicorn -w 6 -k uvicorn.workers.UvicornWorker --reload --bind 0.0.0.0:${PORT:-8000} app.main:app'
volumes:
- ./services/backend/:/backend/
ports:
- "8002:8000"
environment:
- DATABASE_URL=postgresql://fastapi:fastapi@db/fastapi_dev
# To generate a secren run a command like: openssl rand -hex 32
- SECRET_KEY=de9d641c1d6ae7ef29c8f94baa60dc0c580964f6804ff137bc6ace5d63e0f3e5
- ALGORITHM=HS256
- FASTAPI_ADMIN_EMAIL=admin@kpi.ua
- FASTAPI_ADMIN_PASSWORD=admin
- PORT=8000
- CORS_ORIGINS=http://localhost:8001,https://some.app/
- FRONTEND_PATH=https://поставтеєшку-але-можнабільше.укр/
frontend:
container_name: react-frontend
stdin_open: true
build:
context: ./services/frontend
dockerfile: Dockerfile
depends_on:
- backend
volumes:
- './services/frontend:/frontend'
- './services/frontend/node_modules:/frontend/node_modules'
ports:
- "8001:8001"
db:
image: postgres:14-bullseye
volumes:
- postgres_data:/var/lib/postgresql/data/
expose:
- 5432
environment:
- POSTGRES_USER=fastapi
- POSTGRES_PASSWORD=fastapi
- POSTGRES_DB=fastapi_dev
pgadmin:
image: dpage/pgadmin4
environment:
- PGADMIN_DEFAULT_EMAIL=admin@admin.admin
- PGADMIN_DEFAULT_PASSWORD=admin
- PGADMINPORT=8081
ports:
- "8081:80"
profiles:
- donotstart
volumes:
postgres_data:
name: postgres_data