docs: Add Docker install guide #348

Merged
norm merged 6 commits from docs/docker into main 2023-04-01 14:22:43 +00:00
Owner

Based on Misskey's Docker guide:
https://github.com/misskey-dev/misskey-hub/blob/main/src/en/docs/install/docker.md

May need some more changes to make it work better for FoundKey, so it's WIP for now.

Based on Misskey's Docker guide: https://github.com/misskey-dev/misskey-hub/blob/main/src/en/docs/install/docker.md May need some more changes to make it work better for FoundKey, so it's WIP for now.
First-time contributor

Some changes that need to be changed inside the default.yml when using Docker is setting the database host to db and the redis host to redis so that it uses the internal container network to connect over to those containers.

I'm not amazing at wording things so if someone wants to make this understandable inside the document, that'd be amazing.

Aside from that, setting up Foundkey like anything else, it will just compile the container, build Foundkey and start the instance with a simple docker-compose up -d, there's no need to do anything else between editing configs and this.

Might be worth stating that you can use docker-compose logs -f to monitor the output of the containers in cases of issues.

Some changes that need to be changed inside the default.yml when using Docker is setting the database host to `db` and the redis host to `redis` so that it uses the internal container network to connect over to those containers. I'm not amazing at wording things so if someone wants to make this understandable inside the document, that'd be amazing. Aside from that, setting up Foundkey like anything else, it will just compile the container, build Foundkey and start the instance with a simple `docker-compose up -d`, there's no need to do anything else between editing configs and this. Might be worth stating that you can use `docker-compose logs -f` to monitor the output of the containers in cases of issues.
Author
Owner

Wondering if I should move docker-compose.yml to docker-compose.yml.example so that it matches with the docs...

Wondering if I should move `docker-compose.yml` to `docker-compose.yml.example` so that it matches with the docs...
EpicKitty requested changes 2023-02-24 00:02:02 +00:00
@ -0,0 +63,4 @@
git pull
git stash pop
docker compose build
docker compose stop && docker compose up -d
First-time contributor

docker compose stop will just stop the container instead of removing it. In this case, it will cause docker compose up -d to just restart the stopped container which will still use the previous image, rather than start a new container with the updated image.

As the postgres database uses a volume to load the database directory into the container, this poses virtually no risk but it might be worth advising the user to ensure they're keeping good backups. Redis is memory based so nothing should be stored to disk in this case too.

`docker compose stop` will just stop the container instead of removing it. In this case, it will cause `docker compose up -d` to just restart the stopped container which will still use the previous image, rather than start a new container with the updated image. As the postgres database uses a volume to load the database directory into the container, this poses virtually no risk but it might be worth advising the user to ensure they're keeping good backups. Redis is memory based so nothing should be stored to disk in this case too.
Author
Owner

What would be the more appropriate command to rebuild the containers? Thinking of using docker compose up --force-recreate --build -d...

What would be the more appropriate command to rebuild the containers? Thinking of using `docker compose up --force-recreate --build -d`...
First-time contributor

Just simply switching out stop to down would be fine here. Keeping the build process as a seperate command is a nice feature here as you can be rebuilding the Foundkey image whilst the instance is still online without impacting the currently running instance (aside from CPU and Memory resources).

Then doing a docker compose down && docker compose up -d will take the instance offline, delete the current container and then start up a new container on the new image.

Just simply switching out `stop` to `down` would be fine here. Keeping the build process as a seperate command is a nice feature here as you can be rebuilding the Foundkey image whilst the instance is still online without impacting the currently running instance (aside from CPU and Memory resources). Then doing a `docker compose down && docker compose up -d` will take the instance offline, delete the current container and then start up a new container on the new image.
norm marked this conversation as resolved
First-time contributor

Wondering if I should move docker-compose.yml to docker-compose.yml.example so that it matches with the docs...

Most projects I come across that have the option to run the service in Docker will just keep the file as docker-compose.yml, you'd usually store it as an example file if it's going to require modification before being usable. In this case however, as long as the configs have been changed correctly, it will just work.

Just my 2 cents on this.

> Wondering if I should move `docker-compose.yml` to `docker-compose.yml.example` so that it matches with the docs... Most projects I come across that have the option to run the service in Docker will just keep the file as `docker-compose.yml`, you'd usually store it as an example file if it's going to require modification before being usable. In this case however, as long as the configs have been changed correctly, it will just work. Just my 2 cents on this.
norm force-pushed docs/docker from 41ca522faa to 8700f5b5db 2023-03-21 07:12:45 +00:00 Compare
norm changed title from WIP: docs: Add Docker install guide to docs: Add Docker install guide 2023-03-21 07:12:55 +00:00
Author
Owner

These instructions should work now. Would appreciate testing from others or any sort of suggestions for improving this guide.

These instructions should work now. Would appreciate testing from others or any sort of suggestions for improving this guide.
Contributor

I'd maybe add something about migrating to podman after installing, but idk how needed/difficult that is, and probably would be a separate page anyway.
and of course instead of pulling and stashing, I fetch and rebase, but I guess that's personal preference

I'd maybe add something about migrating to podman after installing, but idk how needed/difficult that is, and probably would be a separate page anyway. and of course instead of pulling and stashing, I fetch and rebase, but I guess that's personal preference
Author
Owner

I'd maybe add something about migrating to podman after installing, but idk how needed/difficult that is, and probably would be a separate page anyway.

I personally think switching between podman and docker would be out of scope for this doc. There probably are resources out there that can help with that, but maybe I could add it at a later date once I get familiar with that process.

and of course instead of pulling and stashing, I fetch and rebase, but I guess that's personal preference

Gonna just stick to pull/stash for now since it's close to how the main install guide does it (though it might be changed to what #117 proposes if that gets merged)

> I'd maybe add something about migrating to podman after installing, but idk how needed/difficult that is, and probably would be a separate page anyway. I personally think switching between podman and docker would be out of scope for this doc. There probably are resources out there that can help with that, but maybe I could add it at a later date once I get familiar with that process. > and of course instead of pulling and stashing, I fetch and rebase, but I guess that's personal preference Gonna just stick to pull/stash for now since it's close to how the main install guide does it (though it might be changed to what https://akkoma.dev/FoundKeyGang/FoundKey/pulls/117 proposes if that gets merged)
norm force-pushed docs/docker from e78d67e9c7 to 5662635d45 2023-03-22 22:39:11 +00:00 Compare
norm added 1 commit 2023-03-25 05:43:02 +00:00
Update instructions to match changes in da246ce419
Some checks failed
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline failed
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/lint-backend Pipeline failed
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-sw Pipeline failed
ci/woodpecker/pr/test Pipeline failed
9b7dcb4262
norm requested review from EpicKitty 2023-04-01 09:59:16 +00:00
EpicKitty approved these changes 2023-04-01 13:43:05 +00:00
norm merged commit 24db102679 into main 2023-04-01 14:22:43 +00:00
norm deleted branch docs/docker 2023-04-01 14:22:43 +00:00
Sign in to join this conversation.
No reviewers
No labels
feature
fix
upkeep
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: FoundKeyGang/FoundKey#348
No description provided.