Skip to content

Commit a6a46b9

Browse files
authored
Create docker-compose.yml
1 parent ebadd6e commit a6a46b9

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

docker-compose.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
services:
2+
# 1. Database: MS SQL Server
3+
db:
4+
image: mcr.microsoft.com/mssql/server:2022-latest
5+
container_name: nafath-sql
6+
environment:
7+
- ACCEPT_EULA=Y
8+
- MSSQL_SA_PASSWORD=Password123
9+
- MSSQL_PID=Developer
10+
ports:
11+
- "1433:1433"
12+
healthcheck:
13+
test: ["CMD-SHELL", "/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P 'Password123' -Q 'SELECT 1' -C"]
14+
interval: 10s
15+
timeout: 5s
16+
retries: 5
17+
18+
# 2. Backend: Spring Boot
19+
backend:
20+
build: ./backend
21+
container_name: nafath-backend
22+
ports:
23+
- "8080:8080"
24+
environment:
25+
- SPRING_DATASOURCE_URL=jdbc:sqlserver://db:1433;databaseName=nafath_db;encrypt=true;trustServerCertificate=true
26+
- SPRING_DATASOURCE_USERNAME=sa
27+
- SPRING_DATASOURCE_PASSWORD=Password123
28+
- SPRING_JPA_HIBERNATE_DDL_AUTO=update
29+
depends_on:
30+
db:
31+
condition: service_healthy
32+
33+
# 3. Frontend: Next.js
34+
frontend:
35+
build: ./frontend
36+
container_name: nafath-frontend
37+
ports:
38+
- "3000:3000"
39+
environment:
40+
- NEXT_PUBLIC_API_BASE=http://localhost:8080/nafath/api/v1
41+
depends_on:
42+
- backend

0 commit comments

Comments
 (0)