Skip to content

Document containers#73

Merged
chatterchats merged 6 commits intomasterfrom
feature/docker
Apr 12, 2024
Merged

Document containers#73
chatterchats merged 6 commits intomasterfrom
feature/docker

Conversation

@dealloc
Copy link
Member

@dealloc dealloc commented Apr 12, 2024

This PR adds additional documentation for running the application in Docker/Podman containers.
It also adds a build flag to the Dockerfile so that OpenAPI support (Swagger and JSON files) can be bundled in the container (off by default, since we don't serve it on the hosted version)

@dealloc dealloc added the documentation Improvements or additions to documentation label Apr 12, 2024
@dealloc dealloc added this to the V1 milestone Apr 12, 2024
@dealloc dealloc requested a review from a team April 12, 2024 12:39
@dealloc dealloc self-assigned this Apr 12, 2024
@dealloc dealloc linked an issue Apr 12, 2024 that may be closed by this pull request
@dealloc
Copy link
Member Author

dealloc commented Apr 12, 2024

set to draft as we're awaiting feedback for #46

@dealloc
Copy link
Member Author

dealloc commented Apr 12, 2024

also contemplating if this should be blocked by #70 as I feel rate limits may be one of the main reasons to self host, so having this documented is definitely a must

@stnokott
Copy link
Contributor

As mentioned by @dealloc in #72, the OPENAPI=true buildarg does not enable the SwaggerUI.

While it's easily possible to take the OpenAPI spec at /Helldivers-2-API.json and put that into any regular Swagger Editor, I would love to have the SwaggerUI directly available within the container for simplicity sake.

It's not a major concern, but it would save some clicks when the API changes.

Thanks for the great work on the docs/containers.md documentation!

dealloc added a commit that referenced this pull request Apr 12, 2024
@dealloc
Copy link
Member Author

dealloc commented Apr 12, 2024

As mentioned by @dealloc in #72, the OPENAPI=true buildarg does not enable the SwaggerUI.

While it's easily possible to take the OpenAPI spec at /Helldivers-2-API.json and put that into any regular Swagger Editor, I would love to have the SwaggerUI directly available within the container for simplicity sake.

It's not a major concern, but it would save some clicks when the API changes.

Thanks for the great work on the docs/containers.md documentation!

that was an easy fix, 1ae220f should address this by just copying all openapi files rather than just the spec files

@dealloc
Copy link
Member Author

dealloc commented Apr 12, 2024

as confirmed in #46 (comment) and #72 this PR is now available for review 🥳

@dealloc dealloc marked this pull request as ready for review April 12, 2024 13:19
@dealloc dealloc requested a review from chatterchats as a code owner April 12, 2024 13:19
@stnokott
Copy link
Contributor

stnokott commented Apr 12, 2024

was an easy fix, 1ae220f should address this by just copying all openapi files rather than just the spec files

Where is the SwaggerUI available under?

wwwroot doesn't contain the swagger-ui.html after building with 1ae220f.
image

Build log also looks suspiciously empty:

#19 [api build 13/14] RUN if [[ "true" = 'true' ]];   then     echo "OPENAPI is set to true, running OpenAPI generators"     && dotnet build "Helldivers-2-API.csproj" --no-restore -c Debug     && mkdir -p wwwroot     && cp /docs/openapi/* wwwroot/   ; fi
#19 0.190 OPENAPI is set to true, running OpenAPI generators
#19 0.346 MSBuild version 17.9.8+b34f75857 for .NET
#19 2.143   Helldivers-2-SourceGen -> /src/Helldivers-2-SourceGen/bin/Debug/netstandard2.0/Helldivers-2-SourceGen.dll
#19 3.353   Helldivers-2-Models -> /src/Helldivers-2-Models/bin/Debug/net8.0/Helldivers-2-Models.dll
#19 3.612   Helldivers-2-Core -> /src/Helldivers-2-Core/bin/Debug/net8.0/Helldivers-2-Core.dll
#19 3.913   Helldivers-2-Sync -> /src/Helldivers-2-Sync/bin/Debug/net8.0/Helldivers-2-Sync.dll
#19 4.951   Helldivers-2-API -> /src/Helldivers-2-API/bin/Debug/net8.0/Helldivers-2-API.dll
#19 4.956   
#19 4.956   GenerateOpenApiDocuments:
#19 4.956     dotnet "/root/.nuget/packages/microsoft.extensions.apidescription.server/8.0.3/build/../tools/dotnet-getdocument.dll" --assembly "/src/Helldivers-2-API/bin/Debug/net8.0/Helldivers-2-API.dll" --file-list "obj/Helldivers-2-API.OpenApiFiles.cache" --framework ".NETCoreApp,Version=v8.0" --output "/docs/openapi" --project "Helldivers-2-API" --assets-file "/src/Helldivers-2-API/obj/project.assets.json" --platform "AnyCPU"
#19 5.323   warn: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[16]
#19 5.323         The WebRootPath was not found: /src/Helldivers-2-API/wwwroot. Static files may be unavailable.
#19 5.356   Generating document named 'v1'.
#19 5.650   Writing document named 'v1' to '/docs/openapi/Helldivers-2-API.json'.
#19 5.650   Generating document named 'arrowhead'.
#19 5.673   Writing document named 'arrowhead' to '/docs/openapi/Helldivers-2-API_arrowhead.json'.
#19 5.686
#19 5.687 Build succeeded.
#19 5.687     0 Warning(s)
#19 5.687     0 Error(s)
#19 5.687
#19 5.687 Time Elapsed 00:00:05.20
#19 DONE 5.7s

@dealloc
Copy link
Member Author

dealloc commented Apr 12, 2024

oops, looks like that's on me
I forgot to copy the OpenAPI files in the build container before copying them, will fix that right away

dealloc added a commit that referenced this pull request Apr 12, 2024
dealloc added a commit that referenced this pull request Apr 12, 2024
@dealloc
Copy link
Member Author

dealloc commented Apr 12, 2024

@stnokott could you verify if the last 2 commits fixed the issue of Swagger not being available?

dealloc added a commit that referenced this pull request Apr 12, 2024
dealloc added a commit that referenced this pull request Apr 12, 2024
dealloc added a commit that referenced this pull request Apr 12, 2024
@stnokott
Copy link
Contributor

@stnokott could you verify if the last 2 commits fixed the issue of Swagger not being available?

Fixed!

All my needs are satisfied now 😄

@stnokott
Copy link
Contributor

Thanks for the swift fixes!

@dealloc
Copy link
Member Author

dealloc commented Apr 12, 2024

@chatterchats looks this is all ready for you then!

Copy link
Contributor

@chatterchats chatterchats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ayo, documentation? Imagine!

@chatterchats chatterchats merged commit ec1e49a into master Apr 12, 2024
@chatterchats chatterchats deleted the feature/docker branch April 12, 2024 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Docker Setup

3 participants

Comments