-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
72 lines (67 loc) · 1.88 KB
/
docker-compose.yml
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
version: '3.4'
volumes:
db_data:
services:
db:
image: mcr.microsoft.com/mssql/server:2022-latest
ports:
- 1433:1433
restart: unless-stopped
environment:
- ACCEPT_EULA=Y
- SA_PASSWORD=Microsoft2021!
- MSSQL_PID=Developer
- TZ=Utc
volumes:
- type: volume
source: db_data
target: /var/opt/mssql
hostname: db
db-init:
image: mcr.microsoft.com/mssql-tools
restart: on-failure
environment:
- DB_HOST=db
# must be in double quotes to appease the T-SQL gods
- DB_NAME="SCAlcoholLicenses"
- SA_PASSWORD=Microsoft2021!
command: >
bash -c '/opt/mssql-tools/bin/sqlcmd -S $$DB_HOST -U sa -P $$SA_PASSWORD -b -Q "
IF NOT EXISTS ( SELECT * FROM sys.databases WHERE name = $$DB_NAME )
BEGIN
CREATE DATABASE [$$DB_NAME];
END
"'
depends_on:
db:
condition: service_started
migrations:
image: ghcr.io/chrismeller/scalcohollicenses:main
build: ./
environment:
- CUSTOMCONNSTR_DefaultConnection=Server=db;Database=SCAlcoholLicenses;User Id=sa;Password=Microsoft2021!;
- DOTNET_ENVIRONMENT=Production
- DOTNET_BUNDLE_EXTRACT_BASE_DIR=/tmp
- TZ=Utc
restart: "no"
command: sh -c ./efbundle.exe --connection $$CUSTOMCONNSTR_DefaultConnection
depends_on:
db-init:
condition: service_completed_successfully
app:
image: ghcr.io/chrismeller/scalcohollicenses:main
build: ./
environment:
- CUSTOMCONNSTR_DefaultConnection=Server=db;Database=SCAlcoholLicenses;User Id=sa;Password=Microsoft2021!
- DOTNET_ENVIRONMENT=Production
- TZ=Utc
env_file:
- .env
restart: on-failure
security_opt:
- "seccomp=seccomp_profile.json"
depends_on:
db:
condition: service_started
migrations:
condition: service_completed_successfully