Repository navigation
Expand file tree
/
Copy pathlocal_environment.dockercompose.yaml
More file actions
151 lines (144 loc) · 6.18 KB
/
Copy pathlocal_environment.dockercompose.yaml
File metadata and controls
151 lines (144 loc) · 6.18 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
services:
api:
image: tb.dancedance.api:latest
container_name: tbdancedanceapi
build:
dockerfile: /backend/TB.DanceDance.API/Dockerfile
context: ./src/
args:
BUILD_CONFIGURATION: Debug
depends_on:
- azuriteStorage
- postgresDb
- authserver
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_HTTPS_PORTS=8081
# TO GENERATE CERT ON YOUR MACHINE and share it with docker image:
# dotnet dev-certs https --clean
# dotnet dev-certs https -ep $env:USERPROFILE\.aspnet\https\aspnetapp.pfx -p 2918379123298173918273861
- ASPNETCORE_Kestrel__Certificates__Default__Password=2918379123298173918273861
- ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx
- TB:DanceDance:Cors:Origins=http://localhost:3000/
# Must equal AuthServer:Issuer — embedded in JWT 'iss' claim and OIDC discovery document.
- Authentication:Authority=https://localhost:7259/
- Authentication:Audience=tbdancedanceapi
# Discovery fetched via host.docker.internal — dev cert validation is bypassed in BackchannelHttpHandler.
- Authentication:MetadataAddress=https://host.docker.internal:7259/.well-known/openid-configuration
- ConnectionStrings:PostgreDb=Server=host.docker.internal;Port=5432;Userid=postgres;Password=rgFraWIuyxONqWCQ71wh;Database=dancedance
- ConnectionStrings:Blob=AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;DefaultEndpointsProtocol=http;BlobEndpoint=http://host.docker.internal:10000/devstoreaccount1;QueueEndpoint=http://host.docker.internal:10001/devstoreaccount1;TableEndpoint=http://host.docker.internal:10002/devstoreaccount1;
volumes:
- $USERPROFILE\.aspnet\https\aspnetapp.pfx:/https/aspnetapp.pfx
- dataProtectionKeys:/home/app/.aspnet/DataProtection-Keys/
- ./src/backend/TB.DanceDance.API/appsettings.json:/app/appsettings.json
ports:
- "7068:8081"
- "8080:8080"
authserver:
image: tb.auth.web:latest
container_name: tbauthserver
build:
dockerfile: authserver/Dockerfile
context: ./src/
depends_on:
- postgresDb
extra_hosts:
- "host.docker.internal:host-gateway"
env_file:
# Generate this file with: .\tools\generateAuthSigningCert.ps1
- ./.env.authserver-certs
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_HTTPS_PORTS=8081
- ASPNETCORE_Kestrel__Certificates__Default__Password=2918379123298173918273861
- ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx
- ConnectionStrings:AuthDbConnectionString=Server=host.docker.internal;Port=5432;Userid=postgres;Password=rgFraWIuyxONqWCQ71wh;Database=tbauthwebdb
- AuthServer:Issuer=https://localhost:7259/
- AuthServer:AllowWeakPasswords=true
- AuthServer:AllowedCorsOrigins:0=http://localhost:3000
volumes:
- $USERPROFILE\.aspnet\https\aspnetapp.pfx:/https/aspnetapp.pfx
- authServerDataProtectionKeys:/home/app/.aspnet/DataProtection-Keys/
ports:
- "7259:8081" # HTTPS - browser auth redirects
- "5296:8080" # HTTP - API discovery (avoids cert validation inside Docker)
postgresDb:
image: postgres
environment:
- POSTGRES_PASSWORD=rgFraWIuyxONqWCQ71wh
ports:
- "5432:5432"
volumes:
- postgresDance:/var/lib/postgresql
azuriteStorage:
image: mcr.microsoft.com/azure-storage/azurite
volumes:
- azuriteStorageDance:/data
ports:
- "10000:10000"
- "10001:10001"
- "10002:10002"
# Angular web app (src/my-dance.web). For frontend hot-reload development run
# the backend without this container and use `npm start` instead:
# docker compose -f local_environment.dockercompose.yaml up --scale frontendspa=0
# cd src/my-dance.web && npm start # serves on http://localhost:3000
frontendspa:
image: ddwebapp:latest
container_name: tbdancefrontend
depends_on:
- api
build:
dockerfile: Dockerfile
context: src/my-dance.web
environment:
# Browser-reachable hosts (host-published ports). redirectUri defaults to
# window.origin + /callback (http://localhost:3000/callback), which matches
# the auth server's registered redirect — so it's left unset here.
- API_BASE_URL=https://localhost:7068
- AUTH_URL=https://localhost:7259
ports:
- "3000:80"
converter:
image: ddconverter:latest
container_name: tbdanceconverter
depends_on:
- api
build:
dockerfile: TB.DanceDance.Services.Converter.Deamon/Dockerfile
context: src/backend
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
- DOTNET_ENVIRONMENT=Development
- tb_dancedance_converter_ConverterConfig__OAuthOrigin=https://host.docker.internal:7259/
- tb_dancedance_converter_ConverterConfig__ApiOrigin=https://host.docker.internal:7068/
- tb_dancedance_converter_ConverterConfig__TokenProviderOptions__ClientSecret=Other
- tb_dancedance_converter_ConverterConfig__TokenProviderOptions__ClientId=tbdancedanceconverter
- tb_dancedance_converter_ConverterConfig__TokenProviderOptions__Scope=tbdancedanceapi.convert
- tb_dancedance_converter_ConverterConfig__DelayInMinutes=1
# API SAS URLs embed 127.0.0.1 (Azurite's host-published port, fine for the browser),
# but 127.0.0.1 is unreachable from inside Docker. Remap to the internal service name.
- tb_dancedance_converter_ConverterConfig__BlobEndpointOverride=http://azuriteStorage:10000
initializator:
image: initializator:latest
container_name: tbdanceInitializer
build:
dockerfile: local_environment.initializator.dockerfile
context: .
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
- BlobStorageHostName=host.docker.internal
- DB_HOST=host.docker.internal
- DB_NAME=dancedance
- AUTH_DBNAME=tbauthwebdb
depends_on:
- postgresDb
- azuriteStorage
volumes:
postgresDance:
azuriteStorageDance:
dataProtectionKeys:
authServerDataProtectionKeys: