diff --git a/db/.gitignore b/db/.gitignore new file mode 100644 index 0000000..2171e8d --- /dev/null +++ b/db/.gitignore @@ -0,0 +1,6 @@ +# src https://stackoverflow.com/questions/115983/how-do-i-add-an-empty-directory-to-a-git-repository + +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..b6e2d01 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +services: + devicehub-django: + init: true + build: + dockerfile: docker/devicehub-django.Dockerfile + environment: + DEBUG: true + volumes: + - .:/opt/devicehub-django + ports: + - 8000:8000 + diff --git a/docker/devicehub-django.Dockerfile b/docker/devicehub-django.Dockerfile new file mode 100644 index 0000000..2f734b4 --- /dev/null +++ b/docker/devicehub-django.Dockerfile @@ -0,0 +1,35 @@ +FROM python:3.11.7-slim-bookworm + +# last line is dependencies for weasyprint (for generating pdfs in lafede pilot) https://doc.courtbouillon.org/weasyprint/stable/first_steps.html#debian-11 +RUN apt update && \ + apt-get install -y \ + python3-xapian \ + git \ + sqlite3 \ + jq \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /opt/devicehub-django + +# reduce size (python specifics) -> src https://stackoverflow.com/questions/74616667/removing-pip-cache-after-installing-dependencies-in-docker-image +ENV PYTHONDONTWRITEBYTECODE=1 +# here document in dockerfile src https://stackoverflow.com/questions/40359282/launch-a-cat-command-unix-into-dockerfile +RUN cat > /etc/pip.conf <