The easiest way to get started is by using Docker Compose.
Clone or download the code from Github in a folder like
zaakmagazijn
:$ git clone [email protected]:Haarlem/zaakregistratiecomponent.git zakenmagazijn Cloning into 'zakenmagazijn'... ... $ cd zakenmagazijn
Start the database and Zakenmagazijn services:
$ docker-compose up -d Starting zakenmagazijn_db_1 ... done Starting zakenmagazijn_web_1 ... done
Create an admin user for our Zakenmagazijn and load initial data. If different container names are shown above, use the container name ending with
_web_1
:$ docker exec -it zakenmagazijn_web_1 /app/src/manage.py createsuperuser Username: admin ... Superuser created successfully. $ docker exec -it zakenmagazijn_web_1 /app/src/manage.py loaddata admin_index groups Installed 5 object(s) from 2 fixture(s)
Point your browser to
http://localhost:8000/
to access the Zaaktypecatalogus with the credentials used in step 3.If you are using
Docker Machine
, you need to point your browser to the Docker VM IP address. You can get the IP address by doingdocker-machine ls
and point your browser tohttp://<ip>:8000/
instead (where the IP is shown below the URL column):$ docker-machine ls NAME ACTIVE DRIVER STATE URL default * virtualbox Running tcp://<ip>:<port>
To shutdown the services, use
docker-compose down
.
If you just want to run the Zaaktypecatalogus as a Docker container and
connect to an external database, you can build and run the Dockerfile
and
pass several environment variables. See src/zaakmagazijn/conf/docker.py
for all
settings.
$ docker build . && docker run \
-p 8000:8000 \
-e DJANGO_SETTINGS_MODULE=zaakmagazijn.conf.docker \
-e DATABASE_USERNAME=... \
-e DATABASE_PASSWORD=... \
-e DATABASE_HOST=... \
--name zakenmagazijn
$ docker exec -it zakenmagazijn /app/src/manage.py createsuperuser