-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
48 lines (45 loc) · 1.13 KB
/
docker-compose.prod.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
36
37
38
39
40
41
42
43
44
45
46
47
48
services:
# Django Backend Service
backend:
build:
context: ./backend
dockerfile: Dockerfile.prod
container_name: portfolio-backend
restart: unless-stopped
env_file: .env
depends_on:
- db
volumes:
- /opt/portfolio-website/backend/staticfiles:/home/backend/django/staticfiles
- /opt/portfolio-website/backend/mediafiles:/home/backend/django/mediafiles
user: "backend:backend_group"
ports:
- "4040:4040"
# PostgreSQL Database Service
db:
image: postgres:17-alpine
container_name: portfolio-db
restart: unless-stopped
env_file: .env
environment:
- POSTGRES_DB=${POSTGRESQL_DB}
- POSTGRES_USER=${POSTGRESQL_USER}
- POSTGRES_PASSWORD=${POSTGRESQL_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
# Vite React Frontend Service
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.prod
container_name: portfolio-frontend
restart: unless-stopped
ports:
- "4000:80"
#Volumes & Networks
volumes:
postgres_data:
networks:
default:
external: true
name: portfolio_backend_network