This repository was archived by the owner on Mar 7, 2023. It is now read-only.
Repository navigation
Using Docker
Ben Mitchinson edited this page Mar 11, 2020
·
2 revisions
The application runs on docker, which can be installed here. If you're a linux user, you'll also need to install docker-compose separately. Otherwise, it's included in the Mac and PC versions of "Docker Desktop"
-
docker-compose upWill start each listed service within thedocker-compose.yml.-
docker-compose down(from the root directory) will bring down, "stop" each service. - the
--buildflag of docker-compose will rebuild each container before starting it in a process. - the file flag
-f {....yml}allows you specify a different compose yaml file. This is useful when starting up alternative configurations, like a production config.
-
-
docker pslists all active docker processes.-
docker stop {first 3 chars of container_id}will attempt to stop the process,killwill force it. - you could also use "docker_pwa" (the container name, as specified in the yaml), in place of the container_id
- `docker ps -f "status=exited" will reveal past processes, sometimes these are helpful to remove.
-
-
docker image ls,docker container ls,docker volume ls, will list the respective items. Since containers are built out of layered images, you'll notice that you have a both a "node" image, and a "haiti_pwa" image (which includes the node image within it as a base). Deleting the node imagedocker image rm nodeis almost never useful, but you might need to remove "haiti_pwa" ->docker image rm haiti_pwato force a new build, ifdocker-compose --builddoesn't see that through. -
docker exec -it {container name/id} bashwill open an Interactive bash Terminal (-it) for you to interface with the inside of your container.- Things like installing a new node package are required to be done within the container.
If the database is growing too large for your internal storage, you can mount an external drive and tell docker to use it for hosting.
- Mount the external drive to a location where you won't run into permission issues, such as
/mnt/external-drive/docker-storage - update ownership of that location to be sure with:
chown -R root:root /mnt/external-drive/docker-storageandchmod 701 /mnt/external-drive/docker-storage. - Create
/etc/docker/daemon.jsonwith the contents:
{
"graph": "/mnt/external-drive/docker-storage"
}
- Edit the dockerfile volumes to utilize instead of their defaults
/mnt/external-drive/docker-volumes. - Restart the docker service
After docker build or running the entire compose, the external drive will receive all of the contents.