-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
106 lines (98 loc) · 3.83 KB
/
Copy pathdocker-compose.yml
File metadata and controls
106 lines (98 loc) · 3.83 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
version: '3.9'
# =============================================================================
# VaxTrace Cloud — Local Development Stack
# Emulates the full Azure environment without any cloud credits:
# • Azurite → Azure Storage (Queues + Blob + Table)
# • SQL Server 2022 → Azure SQL Database
# =============================================================================
services:
# ── Azurite: official Microsoft Azure Storage emulator ─────────────────────
azurite:
image: mcr.microsoft.com/azure-storage/azurite:latest
container_name: vaxtrace-azurite
command: >
azurite
--blobHost 0.0.0.0
--queueHost 0.0.0.0
--tableHost 0.0.0.0
--loose
--skipApiVersionCheck
ports:
- "10000:10000" # Blob Storage
- "10001:10001" # Queue Storage
- "10002:10002" # Table Storage
volumes:
- azurite-data:/data
# Removed healthcheck block to bypass shell binary limitations
# ── SQL Server 2022 (Developer Edition — free) ─────────────────────────────
sqlserver:
image: mcr.microsoft.com/mssql/server:2022-latest
container_name: vaxtrace-sql
environment:
SA_PASSWORD: "VaxTrace_Dev123!"
ACCEPT_EULA: "Y"
MSSQL_PID: "Developer"
ports:
- "1434:1433" # Exposed via 1434 to play nice with SchemaForge on 1433
volumes:
- sqlserver-data:/var/opt/mssql
# Removed healthcheck block to avoid internal orchestration loops
# ── DB initialiser: applies schema then exits ──────────────────────────────
db-init:
image: mcr.microsoft.com/mssql-tools:latest
container_name: vaxtrace-db-init
depends_on:
sqlserver:
condition: service_started # Changed from service_healthy
volumes:
- ./backend/sql:/sql
command: >
bash -c "
echo '=== Waiting for SQL Server to accept connections ===' &&
sleep 15 &&
echo '=== Applying VaxTrace schema ===' &&
/opt/mssql-tools/bin/sqlcmd
-S sqlserver -U sa -P 'VaxTrace_Dev123!'
-i /sql/01_schema.sql -b &&
/opt/mssql-tools/bin/sqlcmd
-S sqlserver -U sa -P 'VaxTrace_Dev123!'
-d VaxTraceDB
-i /sql/02_stored_procedures.sql -b &&
/opt/mssql-tools/bin/sqlcmd
-S sqlserver -U sa -P 'VaxTrace_Dev123!'
-d VaxTraceDB
-i /sql/03_seed_data.sql -b &&
echo '=== Schema applied successfully ==='
"
restart: "no"
# ── Queue initialiser: pre-creates the Azurite queue ──────────────────────
queue-init:
image: mcr.microsoft.com/azure-cli:latest
container_name: vaxtrace-queue-init
depends_on:
azurite:
condition: service_started # Changed from service_healthy
environment:
AZURE_STORAGE_CONNECTION_STRING: >
DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;
AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tiqIFbZQ==;
BlobEndpoint=http://azurite:10000/devstoreaccount1;
QueueEndpoint=http://azurite:10001/devstoreaccount1;
TableEndpoint=http://azurite:10002/devstoreaccount1;
command: >
bash -c "
echo '=== Waiting for Azurite core process ===' &&
sleep 5 &&
az storage queue create --name vaccination-queue &&
az storage queue create --name vaccination-deadletter &&
az storage container create --name vaccination-raw-archive &&
az storage container create --name vaccination-processed &&
echo '=== Queues and containers created ==='
"
restart: "no"
volumes:
azurite-data:
sqlserver-data:
networks:
default:
name: vaxtrace-local