freeCodeCamp / devdocs

API Documentation Browser
https://devdocs.io
Mozilla Public License 2.0
34.34k stars 2.29k forks source link

Docker Image Refresh #2270

Open tsengia opened 3 weeks ago

tsengia commented 3 weeks ago

This PR combines the multiple Dockerfile's in the repo into a single, multi-stage Dockerfile that can be used to build both development and production Docker images.

I've also added a devcontainer.json file that can be used with VS Code to provider a containerized development environment. This PR was originally based off of this PR: https://github.com/freeCodeCamp/devdocs/pull/1337

Instead of the Docker image including all the documentation by default, now users are able to select which documentation sections they want to include in their local deployment of DevDocs. This makes it easier/faster to publish new official Docker images of DevDocs because the image size is much smaller. All downloaded documentation and compiled assets are stored in Docker volumes instead of being baked into the image. This also means that new Docker images only need uploaded when code changes, and not when documentation updates.

Finally, this PR adds environment variables that can be used to configure the SSL and origin settings of DevDocs when deployed via Docker container. This helps if deploying DevDocs behind a reverse proxy/load balancer, and when running on Windows via WSL2.

This PR should close:

Once this PR is merged, I would think a new Docker image should be released again, which would close #895 and this PR.

tsengia commented 3 weeks ago

Also, aside from this PR, I would be interested in becoming a maintainer for this repo.