-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
46 lines (36 loc) · 994 Bytes
/
docker-compose.yml
File metadata and controls
46 lines (36 loc) · 994 Bytes
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
services:
# Define the API service
splitifyapi:
# Build the image from the Dockerfile in the current directory
build:
context: .
dockerfile: ./Dockerfile
# Mount local code for development hot-reloading
volumes:
- ./src:/app/src
# Load environment variables from .env file
env_file:
- .env
# Ensure the database is ready before starting the API
depends_on:
- db
ports:
# Expose port 8000 on container to port 8000 on host machine
- 8000:8000
# Expose port 3000 (debugpy) on container to port 3000 on host machine
- 3000:3000
# Define the database service
db:
# Use the Postgres image
image: postgres:16
# Mount a volume to persist the database data
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
volumes:
postgres_data: