Docker compose configuration which setups a development network of TekClinic.
To authenticate Docker with GitHub Container Registry, you need a GitHub Personal Access Token (PAT).
-
Go to GitHub PAT Settings:
-
Generate a New Token:
- Click on "Generate new token (classic)".
- Provide a descriptive Note (e.g., "Docker GHCR Access").
- Set the token Expiration (e.g., 90 days).
-
Select Scopes:
read:packages
: Allows downloading and reading packages.repo
(optional): For private repositories.
-
Generate Token:
- Click "Generate token".
- Copy the token immediately. It won’t be shown again.
Use your newly created PAT to log in to the GitHub Container Registry via Docker.
-
Open a Terminal:
Open your command-line interface (CLI) or terminal.
-
Authenticate Docker:
echo "your_pat" | docker login ghcr.io -u your_username --password-stdin
Replace:
your_pat
with the token you copied.your_username
with your GitHub username.
Example:
echo "ghp_1234567890abcdef1234567890abcdef1234" | docker login ghcr.io -u octocat --password-stdin
If successful, you’ll see a message like
Login Succeeded
.
You have to add the following entries to the end of your hosts
file:
# Tekclinic
127.0.0.1 tekclinic.org
127.0.0.1 auth.tekclinic.org
127.0.0.1 api.tekclinic.org
# End of section
It's needed to redirect your requests to the containers.
Path to hosts
file on Windows is c:\Windows\System32\Drivers\etc\hosts
.
docker compose down && docker compose pull && docker compose up
Rerun this command each time you want to fetch the last updates.
Web App can be accessed on http://tekclinic.org
.
KeyCloak can be accessed on http://auth.tekclinic.org/admin
. Admin user credentials are admin
and admin
.
User with a username test_user
and a password test
is predefined for test purposes.
Public client for Web App that runs on http://tekclinic.org
is also predefined.
API Gateway can be accessed on http://api.tekclinic.org
.
Database can ba accessed on localhost:5432
When the container is created, it's set up with db/init.sql
. If you want to save you db use the following commands:
docker compose exec db sh -c "pg_dumpall --exclude-database=root | sed 's/CREATE ROLE root;//' > init.sql"
docker compose cp db:init.sql db/init.sql