Skip to content

Commit

Permalink
refactor(docker): move env to compose file or dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
thomashilzendegen authored and gingters committed Mar 19, 2024
1 parent e4b07eb commit 7fd6bb1
Show file tree
Hide file tree
Showing 31 changed files with 117 additions and 201 deletions.
2 changes: 1 addition & 1 deletion docs/development-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Scripts to help building and running the system are provided as
and Linux.

A compose file is provided to build all the docker images (`src/docker/docker-compose.yml`). You can build the images
with the `docker compose build` command.
with the `docker compose build` command. An environment variable `RABBITMQ_ERLANG_COOKIE` needs to be set.

## First time Development & Test-Setup

Expand Down
20 changes: 0 additions & 20 deletions src/Thinktecture.Relay.sln
Original file line number Diff line number Diff line change
Expand Up @@ -92,25 +92,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Thinktecture.Relay.Server.I
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Thinktecture.Relay.Server.Management", "Thinktecture.Relay.Server.Management\Thinktecture.Relay.Server.Management.csproj", "{4EF4176E-34E3-477A-8CB1-982A318C3C30}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "environments", "environments", "{0A0F0537-6270-4D1C-AFF7-F998AECCF938}"
ProjectSection(SolutionItems) = preProject
docker\environments\relay_connector.env = docker\environments\relay_connector.env
docker\environments\relay_connector_a1.env = docker\environments\relay_connector_a1.env
docker\environments\relay_connector_a2.env = docker\environments\relay_connector_a2.env
docker\environments\relay_connector_b1.env = docker\environments\relay_connector_b1.env
docker\environments\relay_connector_b2.env = docker\environments\relay_connector_b2.env
docker\environments\relay_identityserver.env = docker\environments\relay_identityserver.env
docker\environments\relay_logging_seq.env = docker\environments\relay_logging_seq.env
docker\environments\relay_management.env = docker\environments\relay_management.env
docker\environments\relay_persistence_postgresql.env = docker\environments\relay_persistence_postgresql.env
docker\environments\relay_server.env = docker\environments\relay_server.env
docker\environments\relay_server_a.env = docker\environments\relay_server_a.env
docker\environments\relay_server_b.env = docker\environments\relay_server_b.env
docker\environments\relay_transport_rabbitmq.env = docker\environments\relay_transport_rabbitmq.env
docker\environments\relay_transport_rabbitmq2.env = docker\environments\relay_transport_rabbitmq2.env
docker\environments\relay_transport_rabbitmq1.env = docker\environments\relay_transport_rabbitmq1.env
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -231,7 +212,6 @@ Global
{84437CA2-F563-4D08-A1CF-A07ECB154884} = {EACF91C8-8B43-4E87-8859-4902B3CC7F63}
{CD190E32-1B0F-48D4-BFF1-43BD388A7C4A} = {D8D76BB9-1D64-43C5-9B7E-710CF4A35374}
{4EF4176E-34E3-477A-8CB1-982A318C3C30} = {D8D76BB9-1D64-43C5-9B7E-710CF4A35374}
{0A0F0537-6270-4D1C-AFF7-F998AECCF938} = {3126FA1D-9755-4842-BDE0-34F7EADF9969}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9CE554FF-A10B-4F63-B480-ED9455F16873}
Expand Down
2 changes: 2 additions & 0 deletions src/docker/Thinktecture.Relay.Connector.Docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,6 @@ RUN chmod u-s /usr/bin/gpasswd /usr/bin/chsh /bin/umount /bin/mount /sbin/unix_c
USER relay
COPY --chown=relay --from=build /app .

ENV DOTNET_ENVIRONMENT=Development

ENTRYPOINT ["dotnet", "Thinktecture.Relay.Connector.Docker.dll"]
Original file line number Diff line number Diff line change
Expand Up @@ -18,59 +18,61 @@
},
"RelayConnector": {
"RelayServerBaseUri": "http://localhost:5000",
"TenantName": "TestTenant1",
"TenantSecret": "<Strong!Passw0rd>",
"Targets": {
"mocky1": {
"Type": "RelayWebTarget",
"Timeout": "00:00:30",
// returns simple JSON ({ "Hello": "World" }) (followed by "?mocky-delay=#ms" to simulate a long running request delayed by #)
"Comment": "returns simple JSON ({ \"Hello\": \"World\" }) (followed by '?mocky-delay=#ms' to simulate a long running request delayed by #)",
"Url": "https://run.mocky.io/v3/9c5f5b7f-a2ce-4067-8d0d-5130feb40e56"
},
"mocky2": {
"Type": "RelayWebTarget",
"Timeout": "00:00:02",
// returns HTTP status NO CONTENT (followed by "?mocky-delay=#ms" to simulate a long running request delayed by #)
"Comment": "returns HTTP status NO CONTENT (followed by '?mocky-delay=#ms' to simulate a long running request delayed by #)",
"Url": "https://run.mocky.io/v3/dd0c23d8-6802-46ea-a188-675d022d0e4d"
},
"mocky3": {
"Type": "RelayWebTarget",
"Timeout": "00:00:02",
// returns big JOSN (followed by "?mocky-delay=#ms" to simulate a long running request delayed by #)
"Comment": "returns big JOSN (followed by '?mocky-delay=#ms' to simulate a long running request delayed by #)",
"Url": "https://run.mocky.io/v3/b0949784-114b-4ea9-80a8-f08aca93c796"
},
"mocky4": {
"Type": "RelayWebTarget",
// returns 307
"Comment": "returns 307",
"Url": "https://run.mocky.io/v3/09b75630-c3ff-4467-876d-ff389a110e30"
},
"status": {
"Type": "RelayWebTarget",
"Timeout": "00:00:02",
// returns HTTP status by appended code (followed by "?sleep=#" to simulate a long running request delayed by # msec)
"Comment": "returns HTTP status by appended code (followed by '?sleep=#' to simulate a long running request delayed by # msec)",
"Url": "https://httpstat.us/"
},
"swapi": {
"Type": "RelayWebTarget",
// returns more complex JSON (e.g. "/api/people/1/")
"Comment": "returns more complex JSON (e.g. '/api/people/1/')",
"Url": "https://swapi.dev/",
"Options": "FollowRedirect"
},
"picsum": {
"Type": "RelayWebTarget",
// returns a random 4k image
"Comment": "returns a random 4k image",
"Url": "https://picsum.photos/3840/2160",
"Options": "FollowRedirect"
},
"smallpdf": {
"Type": "RelayWebTarget",
"Timeout": "01:00:00",
// returns a small pdf (around 10 Mb)
"Comment": "returns a small pdf (around 10 Mb)",
"Url": "https://link.testfile.org/PDF10MB",
"Options": "FollowRedirect"
},
"bigpdf": {
"Type": "RelayWebTarget",
"Timeout": "01:00:00",
// returns a really big pdf (around 100 Mb)
"Comment": "returns a really big pdf (around 100 Mb)",
"Url": "https://link.testfile.org/PDF100MB",
"Options": "FollowRedirect"
},
Expand Down
15 changes: 0 additions & 15 deletions src/docker/Thinktecture.Relay.Connector.Docker/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,2 @@
{
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"System": "Warning"
}
}
},
"RelayConnector": {
"RelayServerBaseUri": "http://relay_server:5000",
"TenantName": "TestTenant1",
"TenantSecret": "<Strong!Passw0rd>"
},
"AllowedHosts": "*"
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ COPY --chown=idsrv --from=build /app .
EXPOSE 5000

ENV ASPNETCORE_URLS=http://+:5000
ENV Serilog__Properties__System=IdentityServer
ENV CertificateStore__Path=/var/signingkeys
ENV CertificateStore__Password=<Strong!Passw0rd>

ENTRYPOINT ["dotnet", "Thinktecture.Relay.IdentityServer.Docker.dll"]
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"PostgreSql": "host=localhost;database=relayserver;username=relayserver;password=<Strong!Passw0rd>"
},
"CertificateStore": {
"Path": "./certificates"
"Password": "<Strong!Passw0rd>"
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,2 @@
{
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"System": "Warning"
}
}
},
"ConnectionStrings": {
"PostgreSql": "host=relay_persistence_postgresql;database=relayserver;username=relayserver;password=<Strong!Passw0rd>"
},
"CertificateStore": {
"Password": "<Strong!Password>"
},
"AllowedHosts": "*"
}
4 changes: 4 additions & 0 deletions src/docker/Thinktecture.Relay.ManagementApi.Docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,9 @@ COPY --chown=relay --from=build /app .
EXPOSE 5000

ENV ASPNETCORE_URLS=http://+:5000
ENV Serilog__Properties__System=Management
ENV Authentication__ApiKey__ApiKeys__read-key__managementapi=read
ENV Authentication__ApiKey__ApiKeys__write-key__managementapi=write
ENV Authentication__ApiKey__ApiKeys__readwrite-key__managementapi=readwrite

ENTRYPOINT ["dotnet", "Thinktecture.Relay.ManagementApi.Docker.dll"]
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,14 @@
},
"ConnectionStrings": {
"PostgreSql": "host=localhost;database=relayserver;username=relayserver;password=<Strong!Passw0rd>"
},
"Authentication": {
"ApiKey": {
"ApiKeys": {
"read-key": { "managementapi": "read" },
"write-key": { "managementapi": "write" },
"readwrite-key": { "managementapi": "readwrite" }
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,26 +1,2 @@
{
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"System": "Warning"
}
}
},
"ConnectionStrings": {
"PostgreSql": "host=relay_persistence_postgresql;database=relayserver;username=relayserver;password=<Strong!Passw0rd>"
},
"Authentication": {
"ApiKey": {
"HeaderName": "TT-Api-Key",
"ApiKeys": {
// map api keys to corresponding claims
"read-key": { "managementapi": "read" },
"write-key": { "managementapi": "write" },
"readwrite-key": { "managementapi": "readwrite" }
}
}
},
"AllowedHosts": "*"
}
3 changes: 3 additions & 0 deletions src/docker/Thinktecture.Relay.Server.Docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,8 @@ COPY --chown=relay --from=build /app .
EXPOSE 5000

ENV ASPNETCORE_URLS=http://+:5000
ENV RabbitMq__ClusterHosts=relay_transport_rabbitmq1,relay_transport_rabbitmq2
ENV BodyStore__StoragePath=/var/bodystore
ENV Authentication__Authority=http://relay_identityserver:5000

ENTRYPOINT ["dotnet", "Thinktecture.Relay.Server.Docker.dll"]
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,16 @@
"ConnectionStrings": {
"PostgreSql": "host=localhost;database=relayserver;username=relayserver;password=<Strong!Passw0rd>"
},
"Kestrel": {
"Limits": {
"MaxRequestBodySize": 115343360
}
},
"Authentication": {
"Authority": "http://localhost:5002"
},
"RabbitMq": {
"Uri": "amqp://relayserver:<Strong!Passw0rd>@localhost",
"Uri": "amqp://guest:guest@localhost",
"ClusterHosts": "localhost:5672,localhost:5673"
},
"RelayServer": {
Expand Down
24 changes: 0 additions & 24 deletions src/docker/Thinktecture.Relay.Server.Docker/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,2 @@
{
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"System": "Warning"
}
}
},
"ConnectionStrings": {
"PostgreSql": "host=relay_persistence_postgresql;database=relayserver;username=relayserver;password=<Strong!Passw0rd>"
},
"Authentication": {
"Authority": "http://relay_identityserver:5000"
},
"RabbitMq": {
"Uri": "amqp://relayserver:<Strong!Passw0rd>@relay_transport_rabbitmq1"
},
"AllowedHosts": "*",
"Kestrel": {
"Limits": {
"MaxRequestBodySize": 115343360
}
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,2 @@
{
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"System": "Warning"
}
}
},
"ConnectionStrings": {
"PostgreSql": "host=relay_persistence_postgresql;database=relayserver;username=relayserver;password=<Strong!Passw0rd>"
},
"AllowedHosts": "*"
}
Loading

0 comments on commit 7fd6bb1

Please sign in to comment.