-
Notifications
You must be signed in to change notification settings - Fork 124
FAQ for Dassie Docker Test App
Prerequisites:
Start/Stop Hyrax:
Hyrax in the Browser:
- How can I access Hyrax in my browser?
- How can I log in as an admin user?
- How can I log in as a basic user?
Testing and Debugging Hyrax:
- How do I set a breakpoint in the application?
- How can I view the application log?
- How do I connect to the application container?
- How do I connect to the database?
- How do I run tests?
Debugging Docker:
- How can I tell if all the containers are running?
- How can I view the logs for a container?
- What to try if the test app doesn't fully start?
For Mac & Windows:
- (recommended) For Mac & Windows, installing Docker Desktop will install the required Docker Engine and Docker Compose. It provides a Dashboard UI where you can view the state of each container, view of logs for each container, start/restart/stop each container, and more. You can install Docker Engine and Docker Compose individually if you prefer. See the links below for other systems.
For other systems:
- (required) Install Docker Engine with CLI client
- (required) Install Docker Compose
All systems:
- (required) Clone hyrax from GitHub.
The images must be built first. This is done the first time you use a container and again if major changes are made and you want to update the container. To do this, execute the following from the root of the hyrax app...
docker compose build
To start the services defined in docker-compose.yml, execute the following from the root of the hyrax app...
docker compose up
To stop the services defined in docker-compose.yml, execute the following from the root of the hyrax app...
docker compose down
There is a predefined admin user:
- username:
[email protected]
- password: _defined in
.dassie/db/seeds.rb
There are two predefined basic users:
- username:
[email protected]
- username:
[email protected]
- password: _defined in
.dassie/db/seeds.rb
TBD
TBD
TBD
Execute the following to connect to the container hosting the database. Once connected you use the postgres CLI to explore the database.
docker-compose run postgres bash
When done, use <CTRL><C>
to exit the connection to the container.
TBD
NOTE: hyrax_3_0_db_migrate_1 and hyrax_3_0_sidekiq_1 will show EXITED (0). These are used for initial migration and then stop.
In Docker Desktop:
- Go to Containers/Apps (left side menu)
- expand
hyrax_3_0
(main content area) - This lists all the containers and their state (e.g. RUNNING, EXITED)
Using the Command Line The following command will list all containers started as services by docker compose. It will list the state of each service (e.g. Up, Exit).
docker-compose ps
In Docker Desktop:
Go to Containers/Apps (left side menu) expand hyrax_3_0
(main content area). This will list all the containers and show the state of each.
Sometimes all the various containers and services do not fully start and connections between containers fail. If this happens, you can try the following in increasing levels of time required for the step to complete. You may not need to do all of this to make your system happy again.
Generally, after trying each step, start the services back up and see if the problem is fixed.
After each step, start services with:
docker compose up
NOTE: The following lists commands to execute in the terminal from the root of hyrax. There are ways to do most of this through Docker Desktop that are not described here.
restart docker compose
docker compose down
docker compose up
restart docker
Easiest way is through the Docker Desktop Dashboard.
- Click the troubleshooting bug in the banner bar of the Desktop app.
- Click
Restart
button next to Restart Docker Desktop.
Most of the time, this is sufficient to get things working again.
prune containers
If all your containers were created by docker compose for hyrax, then there won't be any running after executing the docker compose down
command. But if you use docker for other projects, there may be some hanging around that you don't need.
NOTE: This will delete all stopped containers for all projects, so exercise some caution.
docker compose down
docker container prune
remove images
List images:
docker image ls
This will list all images. If a container does not start, you can remove the image for that container. Copy the image ID from the listing and use it in place of IMAGE_ID in the following command.
docker image remove _IMAGE_ID_ .
If the image is a public image from Docker Hub, then it will be downloaded again when you run docker compose up
. If you needed to remove the image for the Hyrax app, then you will need to rebuild the image first using docker compose build
.
Remove Networks
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
- all dangling images
- all dangling build cache
docker compose down
docker system prune
Last Resort - kill everything
WARNING! This is a last resort.
- Pruning docker volumes will reset all data that generally is persisted when taking the system down and back up.
- Pruning images will require all images to be down loaded or rebuilt which is time consuming.
docker compose down
docker container prune
docker volume prune
docker image prune -a
docker system prune
Perform the steps in How do I start the test app? to start fresh.
Execute the following to connect to the container hosting the database. Once connected you use the postgres CLI to explore the database.
docker-compose run postgres bash
When done, use <CTRL><C>
to exit the connection to the container.