-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
63 lines (60 loc) · 1.73 KB
/
docker-compose.yml
File metadata and controls
63 lines (60 loc) · 1.73 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
53
54
55
56
57
58
59
60
61
62
63
services:
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
target: deps
command: npx next dev --hostname 0.0.0.0
ports:
- "3000:3000"
volumes:
- ./frontend/src:/app/src
- ./frontend/public:/app/public
- ./frontend/tsconfig.json:/app/tsconfig.json
- ./frontend/next.config.ts:/app/next.config.ts
- ./frontend/postcss.config.mjs:/app/postcss.config.mjs
- ./frontend/eslint.config.mjs:/app/eslint.config.mjs
environment:
- API_URL=http://backend:8000
depends_on:
- backend
backend:
build:
context: ./backend
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
ports:
- "8000:8000"
volumes:
- ./backend/app:/app/app
- ./backend/alembic:/app/alembic
- ./backend/alembic.ini:/app/alembic.ini
- ./backend/uploads:/app/uploads
- ./backend/tests:/app/tests
- ./backend/conftest.py:/app/conftest.py
- ./backend/pytest.ini:/app/pytest.ini
env_file:
- .env
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@postgres:5432/${POSTGRES_DB:-studyclever}
depends_on:
postgres:
condition: service_healthy
postgres:
image: postgres:16-alpine
ports:
- "5432:5432"
env_file:
- .env
environment:
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres}
- POSTGRES_DB=${POSTGRES_DB:-studyclever}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
interval: 5s
timeout: 5s
retries: 5
volumes:
postgres_data: