1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-01 22:26:24 -07:00
gochan/docker
2023-12-05 11:44:56 -08:00
..
alpineMysql Update Docker stuff to use Go 1.20, Alpine 3.18 2023-08-30 12:38:36 -07:00
.gitignore Fixes Docker. Adds docker-compose to run a container with mariadb 2020-04-02 21:56:29 -06:00
bootstrap.sh Add explanation if Docker boot fails because of missing js dir, 2023-01-01 15:59:54 -08:00
build-image.sh Update Docker stuff to use Go 1.20, Alpine 3.18 2023-08-30 12:38:36 -07:00
docker-compose-mariadb.yaml Publish ports and detach from container by default 2021-03-01 20:23:53 -08:00
docker-compose-syncForMac.yml Move chain command in Dockerfile CMD to startup script, update Go version in Docker 2023-04-23 20:52:41 -07:00
docker-compose.yml.default Move chain command in Dockerfile CMD to startup script, update Go version in Docker 2023-04-23 20:52:41 -07:00
Dockerfile Update changed example configuration file paths 2023-12-05 11:44:56 -08:00
README.md Update Docker files to use build.py instead of the no longer existing Makefile 2021-02-10 16:22:23 -08:00
startup.sh Build gochan on first run in startup script 2023-04-23 21:56:49 -07:00
SyncForMac Update Docker stuff to use Go 1.20, Alpine 3.18 2023-08-30 12:38:36 -07:00
wait-for.sh Fixes Docker. Adds docker-compose to run a container with mariadb 2020-04-02 21:56:29 -06:00

To run docker you have several choices.

If you want the docker container to use the host's database, copy docker-compose.yml.default to docker-compose.yml and edit the new file with your host's information.

If you want docker to manage the databse, use docker-compose-[database].yml.

If you are using MacOS and need better file sync between the host and the container, use docker-compose-syncForMac.yml.

To use from the root gochan directory, run ./build.py docker, or ./build.py docker ---option macos if you are using MacOS. This will use the MariaDB docker-compose file. If you want to specify which docker-compose file to use, run docker-compose -f [docker-compose.yml file you chose] up --build from this directory. To stop, simply use control+c to send a stop signal. This stops the docker containers but it does not delete them. They are merely frozen.

To delete the containers run docker-compose -f [file you chose] down. If you have a container that has a database (for example, if you chose docker-compose-mariadb.yml), this command will delete the database too.

If you want to use a specific docker-compose file as the default for your own computer, or you want to edit one of the default configurations given here (to change the database type, for example), copy the file and name it docker-compose.yml. This way, you can omit specifying the file when using docker-compose. For example, docker-compose down is the same as docker-compose -f docker-compose.yml down. The file is added to .gitignore so that your local config won't be accidentally commited.

Docker caches builds. When files change, it has to rebuild from whenever that file was added to the docker image. For example, the docker file adds build.py at first and ignores the rest of the files. It uses it to download the dependencies, which can take a while. After that, it adds the rest of the files. This means that if a file is changed in a source file, docker won't have to rebuild. But if build.py changes, it will be forced to rebuild. This can cause Docker to bloat up after a while. Periodically remember to run docker image prune (also search for other deletion commands) to keep docker's storage usage relatively low. All images used thus far use Alpine, which is a small OS compared to Ubuntu or other much larger builds.