diff --git a/README.md b/README.md index 49027d4..5bad44c 100755 --- a/README.md +++ b/README.md @@ -2,10 +2,11 @@ purpose: gather data from intern(WMDE) and extern(volunteers) forms to create a database ('förderdatenbank') and send emails with links for a questionary. -## installation and development setup +## manual development setup cp .env.develop.example .env +By default a SQLite database is used for development. To use a MariaDB change `DATABASE_ENGINE` in .env to `mysql` and amend `DATABASE_*` variables according to your setup. For further information see the production setup below. @@ -27,6 +28,25 @@ access via http://localhost:8000/intern/ (login required) http://localhost:8000/admin/ (login reqiured) +## docker compose development setup + +The project comes with a `docker-compose.yml` file to run the project in a containerized environment. + + cp .env.develop.example .env + docker compose up + +The setup will use a containerized MariaDB database. + +Create your superuser account with + + docker compose exec django python3 manage.py createsuperuser + +You can access the application via + + http://localhost:8000/ + http://localhost:8000/intern/ (login required) + http://localhost:8000/admin/ (login required) + ## additional admin functionality The admin page is the standard admin page delivered by django but with two additional functionalities: diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..4dffd74 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,33 @@ +services: + django: + image: python:3-alpine + working_dir: /app + volumes: + - .:/app + environment: + PYTHONUNBUFFERED: 1 + DATABASE_ENGINE: mysql + DATABASE_HOST: mariadb + DATABASE_USER: fdb + DATABASE_PASSWORD: fdb + ports: + - 8000:8000 + command: + - sh + - -c + - | + apk update + apk add gcc + apk add mariadb-dev + apk add musl-dev + pip install -Ur requirements.txt + python manage.py migrate + python manage.py runserver 0.0.0.0:8000 + + mariadb: + image: mariadb + environment: + MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: yes + MARIADB_DATABASE: fdb + MARIADB_USER: fdb + MARIADB_PASSWORD: fdb