Docker Compose
We include a compose stack for development purposes and for trying out OIP on your own machine.
The docker_compose.yml defines ‘convenience’ settings, meaning that that no additional configuration is needed to run the app. It is not suitable for production.
Getting started
Clone the repository
git clone git@github.com:maykinmedia/open-inwoner.git
Optionally, you you can initialize the database on first startup with an SQL dump by adding it to
docker-init-db.sql/. In order to create a user for the database, add a.sqlscript in the same directory with the following content:DO $do$ BEGIN IF NOT EXISTS ( SELECT FROM pg_roles WHERE rolname = 'open_inwoner') THEN CREATE USER open_inwoner; END IF; END $do$; Choose the rolname/user name depending on the owner of the database in the dump you're loading in. Make sure you get the quotes right: ``rolname`` requires single quotes. If you happen to have a ``USER`` name containing dashes, it must be referenced in double quotes (``"open-inwoner-test"``).Start the docker containers with
docker compose up. If you want to run the containers in the background, add the-doption.Create a super-user:
sudo docker exec -it open-inwoner-web src/manage.py createsuperuser
Navigate to
http://127.0.0.1:8000/admin/and use the credentials created above to log in.To stop the containers, press CTRL-C or if you used the
-doption:docker compose stop
Testing OpenTelemetry Observability
To test the OpenTelemetry setup and view metrics in Grafana:
Start the observability stack first:
bin/start_observability.sh
Start the application with OpenTelemetry enabled:
OTEL_SDK_DISABLED=false docker compose up
Access Grafana dashboard at http://localhost:3000 to view metrics
The observability stack includes monitoring and metrics collection for the application
performance and behavior. The easiest way to see if this is working is to navigate to
the “Drilldown > Metrics” item in the left menu and filter by the otel_ prefix.