Skip to content

Commit

Permalink
feat(docker): add httpbin target for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
thomashilzendegen authored and gingters committed Jul 2, 2024
1 parent 50d51fd commit caf5bf6
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 70 deletions.
2 changes: 1 addition & 1 deletion src/docker/Thinktecture.Relay.Connector.Docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +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
ENV RelayConnector__Targets__httpbin__Url=http://relay-httpbin

ENTRYPOINT ["dotnet", "Thinktecture.Relay.Connector.Docker.dll"]
Original file line number Diff line number Diff line change
Expand Up @@ -18,73 +18,6 @@
},
"RelayConnector": {
"RelayServerBaseUri": "http://localhost:5000",
"TenantName": "TestTenant1",
"TenantSecret": "<Strong!Passw0rd>",
"Targets": {
"mocky1": {
"Type": "RelayWebTarget",
"Timeout": "00:00:30",
"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",
"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/0e213019-ba0d-4cc9-adbb-bf00b95c98dc"
},
"mocky3": {
"Type": "RelayWebTarget",
"Timeout": "00:00:02",
"Comment": "returns big JSON (about 2,4kb) (followed by '?mocky-delay=#ms' to simulate a long running request delayed by #)",
"Url": "https://run.mocky.io/v3/c20ff193-6b29-4b16-9552-512584914b72"
},
"mocky4": {
"Type": "RelayWebTarget",
"Comment": "returns 307",
"Url": "https://run.mocky.io/v3/b1dff4cb-14ec-4b46-b841-708ab662411d"
},
"status": {
"Type": "RelayWebTarget",
"Timeout": "00:00:02",
"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",
"Comment": "returns more complex JSON (e.g. '/api/people/1/')",
"Url": "https://swapi.dev/",
"Options": "FollowRedirect"
},
"picsum": {
"Type": "RelayWebTarget",
"Comment": "returns a random 4k image",
"Url": "https://picsum.photos/3840/2160",
"Options": "FollowRedirect"
},
"smallpdf": {
"Type": "RelayWebTarget",
"Timeout": "01:00:00",
"Comment": "returns a small pdf (around 10 Mb)",
"Url": "https://link.testfile.org/PDF10MB",
"Options": "FollowRedirect"
},
"bigpdf": {
"Type": "RelayWebTarget",
"Timeout": "01:00:00",
"Comment": "returns a really big pdf (around 100 Mb)",
"Url": "https://link.testfile.org/PDF100MB",
"Options": "FollowRedirect"
},
"tt": {
"Type": "RelayWebTarget",
"Url": "https://thinktecture.com",
"Options": "FollowRedirect"
},
"lh": {
"Type": "RelayWebTarget",
"Url": "http://localhost:8080"
}
}
"TenantName": "TestTenant1"
}
}
41 changes: 41 additions & 0 deletions src/docker/Thinktecture.Relay.Connector.Docker/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,43 @@
{
"RelayConnector": {
"TenantSecret": "<Strong!Passw0rd>",
"Targets": {
"status": {
"Type": "RelayWebTarget",
"Timeout": "00:00:02",
"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",
"Comment": "returns more complex JSON (e.g. '/api/people/1/')",
"Url": "https://swapi.dev/",
"Options": "FollowRedirect"
},
"picsum": {
"Type": "RelayWebTarget",
"Comment": "returns a random 4k image",
"Url": "https://picsum.photos/3840/2160",
"Options": "FollowRedirect"
},
"smallpdf": {
"Type": "RelayWebTarget",
"Timeout": "01:00:00",
"Comment": "returns a small pdf (around 10 Mb)",
"Url": "https://link.testfile.org/PDF10MB",
"Options": "FollowRedirect"
},
"bigpdf": {
"Type": "RelayWebTarget",
"Timeout": "01:00:00",
"Comment": "returns a really big pdf (around 100 Mb)",
"Url": "https://link.testfile.org/PDF100MB",
"Options": "FollowRedirect"
},
"httpbin": {
"Type": "RelayWebTarget",
"Url": "http://localhost:8080"
}
}
}
}
10 changes: 9 additions & 1 deletion src/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ x-db-connection: &db-connection
ConnectionStrings__SqlServer: Server=relay-persistence-sqlserver;Database=relayserver;User Id=sa;Password=<Strong!Passw0rd>

x-logging: &logging
Serilog__MinimumLevel__Default: Verbose
Serilog__MinimumLevel__Default: Error
Serilog__MinimumLevel__Override__Microsoft: Warning
Serilog__MinimumLevel__Override__System: Warning
Serilog__WriteTo__0__Name: Seq
Expand Down Expand Up @@ -240,6 +240,14 @@ services:
depends_on:
- relay-connector-b1

relay-httpbin:
<<: *defaults
image: kennethreitz/httpbin
container_name: relay-httpbin
platform: linux/amd64
ports:
- "8080:80"

volumes:
seq-data:
postgresql-data:
Expand Down

0 comments on commit caf5bf6

Please sign in to comment.