* refactor(local): docker compose * fix(compose): disable logging in gateway * docs: guide for local development * docs(local): quickstart * docs: resources * use docker-compose dns * Apply suggestions from code review Co-authored-by: Florian Forster <florian@caos.ch> Co-authored-by: Elio Bischof <eliobischof@gmail.com> Co-authored-by: Florian Forster <florian@caos.ch>
2.2 KiB
Quickstart with docker compose
Prerequisites
The only prerequisite you need fullfill, is that you need to have docker installed with support for compose and buildkit. The resource limit must at least be:
- CPU's: 2
- Memory: 4Gb
Start ZITADEL
You can start ZITADEL with a simple docker compose up.
The services are configured to restart if an error occurs.
In the following script the basic setup of the database is executed before ZITADEL starts. Execute the statement from the root of ZITADEL.
You can connect to ZITADEL on localhost:4200 after the frontend compiled successfully. Initially it takes several minutes to start all containers.
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 \
&& docker compose -f ./build/local/docker-compose-local.yml --profile backend --profile frontend up
For a more detailed guide take a look at the development guide
FAQ
Mac M1 (Apple Silicon)
Bellow are some errors we faced with apple silicon.
database-migrations don't start or stop without exit code
You can simply restart the database with the following command:
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 \
&& docker compose -f ./build/local/docker-compose-local.yml restart db
API call's block and don't return any response
The problem is that the database has a connection issues. You can simply restart the database with the following command:
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 \
&& docker compose -f ./build/local/docker-compose-local.yml restart db
Build Errors
If you experience strange docker error you might need to check that buildkit
is enabled.
Make sure to enable "features": { "buildkit": true }
in your docker settings!
Remove the quickstart
docker-compose -f ./build/local/docker-compose-local.yml --profile database --profile init-backend --profile init-frontend --profile backend --profile frontend rm
If you are confident that you don't need to run the same ZITADEL instance again, go ahead and delete the .keys
folder and reset the environment.json
as well.
rm -rf .keys
git reset build/local/environment.json