-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
65 lines (61 loc) · 1.47 KB
/
docker-compose.yml
File metadata and controls
65 lines (61 loc) · 1.47 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
64
65
services:
database:
image: postgres:15-alpine
container_name: rep-mate-database
environment:
POSTGRES_USER: repmate
POSTGRES_PASSWORD: password
POSTGRES_DB: repmate
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U repmate"]
interval: 10s
timeout: 5s
retries: 5
migration:
build:
context: ./backend
dockerfile: Dockerfile
container_name: rep-mate-migration
environment:
DATABASE_URL: postgresql://repmate:password@database:5432/repmate
depends_on:
database:
condition: service_healthy
volumes:
- ./backend:/app
command: alembic upgrade head
restart: "no"
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: rep-mate-backend
environment:
DATABASE_URL: postgresql://repmate:password@database:5432/repmate
ports:
- "8000:8000"
depends_on:
database:
condition: service_healthy
migration:
condition: service_completed_successfully
volumes:
- ./backend:/app
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: rep-mate-frontend
ports:
- "5173:80"
depends_on:
- backend
environment:
- API_URL=http://localhost:8000
volumes:
postgres_data: