-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
110 lines (103 loc) · 2.57 KB
/
docker-compose.yml
File metadata and controls
110 lines (103 loc) · 2.57 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
version: '3.8'
services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: syllabussync-postgres
environment:
POSTGRES_DB: syllabussync
POSTGRES_USER: syllabussync
POSTGRES_PASSWORD: syllabussync_password
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./database/init:/docker-entrypoint-initdb.d
networks:
- syllabussync-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U syllabussync -d syllabussync"]
interval: 10s
timeout: 5s
retries: 5
# Spring Boot Backend
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: syllabussync-backend
environment:
SPRING_PROFILES_ACTIVE: docker
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/syllabussync
SPRING_DATASOURCE_USERNAME: syllabussync
SPRING_DATASOURCE_PASSWORD: syllabussync_password
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET}
JWT_SECRET: ${JWT_SECRET}
ports:
- "8080:8080"
depends_on:
postgres:
condition: service_healthy
networks:
- syllabussync-network
volumes:
- ./backend/uploads:/app/uploads
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"]
interval: 30s
timeout: 10s
retries: 3
# React Frontend
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: syllabussync-frontend
environment:
REACT_APP_API_BASE_URL: http://localhost:8080/api
REACT_APP_GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID}
ports:
- "3000:3000"
depends_on:
- backend
networks:
- syllabussync-network
# Redis for caching and sessions (optional)
redis:
image: redis:7-alpine
container_name: syllabussync-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- syllabussync-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
# Nginx Reverse Proxy (optional)
nginx:
image: nginx:alpine
container_name: syllabussync-nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/ssl:/etc/nginx/ssl
depends_on:
- frontend
- backend
networks:
- syllabussync-network
volumes:
postgres_data:
driver: local
redis_data:
driver: local
networks:
syllabussync-network:
driver: bridge