-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
37 lines (35 loc) · 969 Bytes
/
docker-compose.yml
File metadata and controls
37 lines (35 loc) · 969 Bytes
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
services:
db:
image: mcr.microsoft.com/mssql/server:2022-latest
container_name: dfx-mssql
environment:
- ACCEPT_EULA=Y
- MSSQL_SA_PASSWORD=LocalDev2026@SQL
- MSSQL_PID=Developer
ports:
- "1433:1433"
volumes:
- mssql_data:/var/opt/mssql
healthcheck:
test: /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "LocalDev2026@SQL" -C -Q "SELECT 1" || exit 1
interval: 10s
timeout: 3s
retries: 10
start_period: 10s
db-init:
image: mcr.microsoft.com/mssql/server:2022-latest
depends_on:
db:
condition: service_healthy
entrypoint: ["/bin/bash", "-c"]
command:
- |
/opt/mssql-tools18/bin/sqlcmd -S db -U sa -P "LocalDev2026@SQL" -C -Q "
IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = 'dfx')
BEGIN
CREATE DATABASE dfx
END
"
echo "Database 'dfx' ready"
volumes:
mssql_data: