Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCode debugging support #278

Merged
merged 18 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["ms-azuretools.vscode-docker", "ms-dotnettools.csdevkit"]
}
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Consumer API (Docker)",
"type": "docker",
"request": "attach",
"platform": "netCore",
"sourceFileMap": {
"/app": "${workspaceFolder}"
},
"containerName": "consumerApi",
"processName": "ConsumerApi"
}
]
}
10 changes: 10 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "start",
"command": "docker",
"args": ["compose", "-f", "docker-compose/docker-compose.yml", "up", "--build", "--attach", "consumerApi"]
}
]
}
2 changes: 1 addition & 1 deletion ConsumerApi/Dockerfile.debug
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ EXPOSE 80

WORKDIR /app

ENTRYPOINT ["dotnet", "run", "--project", "ConsumerApi/ConsumerApi.csproj"]
ENTRYPOINT ["dotnet", "watch", "--non-interactive", "--project", "ConsumerApi/ConsumerApi.csproj"]
48 changes: 24 additions & 24 deletions ConsumerApi/appsettings.override.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,27 @@
"Challenges": {
"Infrastructure": {
"SqlDatabase": {
"Provider": "SqlServer",
"ConnectionString": "Server=ms-sql-server;Database=enmeshed;User Id=challenges;Password=Passw0rd;TrustServerCertificate=True"
//"ConnectionString": "User ID=challenges;Password=Passw0rd;Server=postgres;Port=5432;Database=enmeshed;" // postgres
"Provider": "Postgres",
"ConnectionString": "User ID=challenges;Password=Passw0rd;Server=postgres;Port=5432;Database=enmeshed;" // postgres
// "ConnectionString": "Server=ms-sql-server;Database=enmeshed;User Id=challenges;Password=Passw0rd;TrustServerCertificate=True" // sqlserver
}
}
},
"Quotas": {
"Infrastructure": {
"SqlDatabase": {
"Provider": "SqlServer",
"ConnectionString": "Server=ms-sql-server;Database=enmeshed;User Id=quotas;Password=Passw0rd;TrustServerCertificate=True"
//"ConnectionString": "User ID=quotas;Password=Passw0rd;Server=postgres;Port=5432;Database=enmeshed;" // postgres
"Provider": "Postgres",
"ConnectionString": "User ID=quotas;Password=Passw0rd;Server=postgres;Port=5432;Database=enmeshed;" // postgres
// "ConnectionString": "Server=ms-sql-server;Database=enmeshed;User Id=quotas;Password=Passw0rd;TrustServerCertificate=True" // sqlserver
}
}
},
"Devices": {
"Infrastructure": {
"SqlDatabase": {
"Provider": "SqlServer",
"ConnectionString": "Server=ms-sql-server;Database=enmeshed;User Id=devices;Password=Passw0rd;TrustServerCertificate=True"
//"ConnectionString": "User ID=devices;Password=Passw0rd;Server=postgres;Port=5432;Database=enmeshed;" // postgres
"Provider": "Postgres",
"ConnectionString": "User ID=devices;Password=Passw0rd;Server=postgres;Port=5432;Database=enmeshed;" // postgres
// "ConnectionString": "Server=ms-sql-server;Database=enmeshed;User Id=devices;Password=Passw0rd;TrustServerCertificate=True" // sqlserver
},
"PushNotifications": {
"Provider": "Dummy"
Expand All @@ -58,9 +58,9 @@
"Files": {
"Infrastructure": {
"SqlDatabase": {
"Provider": "SqlServer",
"ConnectionString": "Server=ms-sql-server;Database=enmeshed;User Id=files;Password=Passw0rd;TrustServerCertificate=True"
//"ConnectionString": "User ID=files;Password=Passw0rd;Server=postgres;Port=5432;Database=enmeshed;" // postgres
"Provider": "Postgres",
"ConnectionString": "User ID=files;Password=Passw0rd;Server=postgres;Port=5432;Database=enmeshed;" // postgres
// "ConnectionString": "Server=ms-sql-server;Database=enmeshed;User Id=files;Password=Passw0rd;TrustServerCertificate=True" // sqlserver
},
"BlobStorage": {
"CloudProvider": "Azure",
Expand All @@ -72,9 +72,9 @@
"Messages": {
"Infrastructure": {
"SqlDatabase": {
"Provider": "SqlServer",
"ConnectionString": "Server=ms-sql-server;Database=enmeshed;User Id=messages;Password=Passw0rd;TrustServerCertificate=True"
//"ConnectionString": "User ID=messages;Password=Passw0rd;Server=postgres;Port=5432;Database=enmeshed;" // postgres
"Provider": "Postgres",
"ConnectionString": "User ID=messages;Password=Passw0rd;Server=postgres;Port=5432;Database=enmeshed;" // postgres
// "ConnectionString": "Server=ms-sql-server;Database=enmeshed;User Id=messages;Password=Passw0rd;TrustServerCertificate=True" // sqlserver
},
"BlobStorage": {
"CloudProvider": "Azure",
Expand All @@ -86,9 +86,9 @@
"Relationships": {
"Infrastructure": {
"SqlDatabase": {
"Provider": "SqlServer",
"ConnectionString": "Server=ms-sql-server;Database=enmeshed;User Id=relationships;Password=Passw0rd;TrustServerCertificate=True"
//"ConnectionString": "User ID=relationships;Password=Passw0rd;Server=postgres;Port=5432;Database=enmeshed;" // postgres
"Provider": "Postgres",
"ConnectionString": "User ID=relationships;Password=Passw0rd;Server=postgres;Port=5432;Database=enmeshed;" // postgres
// "ConnectionString": "Server=ms-sql-server;Database=enmeshed;User Id=relationships;Password=Passw0rd;TrustServerCertificate=True" // sqlserver
},
"BlobStorage": {
"CloudProvider": "Azure",
Expand All @@ -100,9 +100,9 @@
"Synchronization": {
"Infrastructure": {
"SqlDatabase": {
"Provider": "SqlServer",
"ConnectionString": "Server=ms-sql-server;Database=enmeshed;User Id=synchronization;Password=Passw0rd;TrustServerCertificate=True"
//"ConnectionString": "User ID=synchronization;Password=Passw0rd;Server=postgres;Port=5432;Database=enmeshed;" // postgres
"Provider": "Postgres",
"ConnectionString": "User ID=synchronization;Password=Passw0rd;Server=postgres;Port=5432;Database=enmeshed;" // postgres
// "ConnectionString": "Server=ms-sql-server;Database=enmeshed;User Id=synchronization;Password=Passw0rd;TrustServerCertificate=True" // sqlserver
},
"BlobStorage": {
"CloudProvider": "Azure",
Expand All @@ -114,9 +114,9 @@
"Tokens": {
"Infrastructure": {
"SqlDatabase": {
"Provider": "SqlServer",
"ConnectionString": "Server=ms-sql-server;Database=enmeshed;User Id=tokens;Password=Passw0rd;TrustServerCertificate=True"
//"ConnectionString": "User ID=tokens;Password=Passw0rd;Server=postgres;Port=5432;Database=enmeshed;" // postgres
"Provider": "Postgres",
"ConnectionString": "User ID=tokens;Password=Passw0rd;Server=postgres;Port=5432;Database=enmeshed;" // postgres
// "ConnectionString": "Server=ms-sql-server;Database=enmeshed;User Id=tokens;Password=Passw0rd;TrustServerCertificate=True" // sqlserver
},
"BlobStorage": {
"CloudProvider": "Azure",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<PackageReference Include="AutoFixture" Version="4.18.0" />
<PackageReference Include="AutoFixture.Xunit2" Version="4.18.0" />
<PackageReference Include="FakeItEasy" Version="7.4.0" />
<PackageReference Include="Microsoft.AspNet.WebApi.Core" Version="5.2.9" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="xunit" Version="2.5.1" />
Expand Down
66 changes: 35 additions & 31 deletions docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ services:
- Modules__Tokens__Infrastructure__BlobStorage__ConnectionInfo=${ENMESHED_BLOB_STORAGE_CONNECTION_STRING} # set this environment variable on your local system to an appropriate value (DefaultEndpointsProtocol=https;AccountName=<account-name>;AccountKey=<account-key>;EndpointSuffix=core.windows.net)

ports:
- "127.0.0.10:80:80"
- "5000:80"
- "8080:80"
depends_on:
- ms-sql-server
# - ms-sql-server
- rabbitmq
- azure-storage-emulator
- postgres
volumes:
- ../:/app
- /app/ConsumerApi/obj
- /app/ConsumerApi/bin

### infrastructure ###

Expand All @@ -42,38 +44,40 @@ services:
volumes:
- azure-storage-emulator-volume:/data

ms-sql-server:
container_name: bkb-mssql_server
hostname: ms-sql-server
image: mcr.microsoft.com/mssql/server:2019-latest
# ms-sql-server:
# container_name: bkb-mssql_server
# hostname: ms-sql-server
# image: mcr.microsoft.com/mssql/server:2019-latest
# environment:
# - MSSQL_SA_PASSWORD=Passw0rd
# - ACCEPT_EULA=Y
# - MSSQL_PID=Express
# volumes:
# - mssql-server-volume:/var/opt/mssql
# ports:
# - 1433:1433

postgres:
container_name: bkb-postgres
hostname: postgres
image: postgres
environment:
- MSSQL_SA_PASSWORD=Passw0rd
- ACCEPT_EULA=Y
- MSSQL_PID=Express
- POSTGRES_PASSWORD=admin
volumes:
- mssql-server-volume:/var/opt/mssql
- postgres-volume:/var/lib/postgresql/data
ports:
- 1433:1433

#postgres:
# container_name: bkb-postgres
# hostname: postgres
# image: postgres
# environment:
# - POSTGRES_PASSWORD=admin
# volumes:
# - postgres-volume:/var/lib/postgresql/data
# ports:
# - 5432:5432
- 5432:5432
depends_on:
- pg-admin

#pg-admin:
# container_name: bkb-pgadmin
# image: dpage/pgadmin4
# ports:
# - 85:80
# environment:
# - PGADMIN_DEFAULT_PASSWORD=admin
# - [email protected]
pg-admin:
container_name: bkb-pgadmin
image: dpage/pgadmin4
ports:
- 85:80
environment:
- PGADMIN_DEFAULT_PASSWORD=admin
- [email protected]

rabbitmq:
container_name: bkb-rabbitmq
Expand Down