-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
35 lines (34 loc) · 1.01 KB
/
docker-compose.yml
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
version: '3.8'
services:
backend:
build:
context: ./backend # Build context, the folder where your Dockerfile is located
dockerfile: Dockerfile # Name of the Dockerfile inside the backend folder
container_name: secret-santa-app
working_dir: /app
volumes:
- ./backend:/app # Mount the backend folder into the container
ports:
- "8080:8089" # Map the container port to the host port
depends_on:
- db
environment:
- DB_HOST=db
- DB_PORT=5432
- DB_USER=postgres
- DB_PASSWORD=secret
- DB_NAME=secret_santa_db
db:
image: postgres:15-alpine # Use PostgreSQL as the database
container_name: secret-santa-db
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: secret
POSTGRES_DB: secret_santa_db
ports:
- "5432:5432" # Expose the database port
#uncomment theese 4 lines to make db data persistant
# volumes:
# - db_data:/var/lib/postgresql/data # Persist database data
# volumes:
# db_data: