-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
47 lines (42 loc) · 1.54 KB
/
docker-compose.yml
File metadata and controls
47 lines (42 loc) · 1.54 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
services: # Declare all the "containers" here
frontend:
build:
context: ./frontend
args:
VITE_BACKEND_URL: ${VITE_BACKEND_URL}
container_name: toki-frontend
ports:
- "5173:5173"
depends_on:
- backend
networks:
- toki-net
env_file:
- .env
backend: # Spring Boot container
build: ./backend # Build from the ./backend/Dockerfile
container_name: toki-backend # Human-readable container name
ports:
- "8080:8080" # Map container port 8080 → host 8080
# depends_on:
# - db # Wait for db container to be ready before backend starts
env_file:
- .env
networks:
- toki-net # Put backend & db on same virtual network
# db: # PostgreSQL container
# image: postgres:16 # Official Postgres image
# container_name: toki-db # Optional readable name
# restart: always # Auto-restart if it crashes
# environment: # Postgres DB config
# POSTGRES_DB: tokidb
# POSTGRES_USER: postgres
# POSTGRES_PASSWORD: tokipass
# volumes:
# - pgdata:/var/lib/postgresql/data # Persist DB data in volume
# networks:
# - toki-net # Same network as backend
networks:
toki-net: # Defines the isolated network
volumes:
pgdata: # Named volume to persist DB files