-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
42 lines (38 loc) · 1.63 KB
/
Copy pathdocker-compose.yml
File metadata and controls
42 lines (38 loc) · 1.63 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
version: '3.9'
services:
# ── SQL Server ─────────────────────────────────────────────────
sqlserver:
image: mcr.microsoft.com/mssql/server:2022-latest
container_name: catalog_sqlserver
environment:
SA_PASSWORD: "Ke@1234!"
ACCEPT_EULA: "Y"
ports:
- "1435:1433" # host:container — use 1435 to avoid conflict with local SQL
volumes:
- sqlserver_data:/var/opt/mssql
healthcheck:
test: ["CMD", "/opt/mssql-tools18/bin/sqlcmd", "-S", "localhost",
"-U", "sa", "-P", "Ke@1234!",
"-Q", "SELECT 1", "-No"]
interval: 10s
retries: 5
timeout: 5s
# ── CatalogService ────────────────────────────────────────────
catalog-api:
build:
context: ./CatalogService # ← where your Dockerfile is
dockerfile: Dockerfile
container_name: catalog_api
ports:
- "5070:8080" # access API at localhost:5060
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ConnectionStrings__DefaultConnection=Server=sqlserver,1433;Database=CatalogDb;User Id=sa;Password=Ke@1234!;TrustServerCertificate=True;
depends_on:
sqlserver:
condition: service_healthy # ← wait for SQL Server to be ready
restart: on-failure
# ── Volumes ────────────────────────────────────────────────────
volumes:
sqlserver_data: