diff --git a/Dockerfile b/Dockerfile index de4a1757..90770e49 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,25 @@ -FROM python:3.9-bullseye +FROM python:3.9-bullseye AS base ENV PYTHONUNBUFFERED=1 RUN pip install poetry WORKDIR /code -RUN apt-get update && apt-get install -y --no-install-recommends gettext-base libpq-dev +RUN apt-get update && apt-get install -y --no-install-recommends gettext-base libpq-dev graphviz COPY pyproject.toml poetry.lock /code/ RUN poetry install --with dev --extras "postgresql" COPY . /code/ -CMD ./docker/docker-entrypoint.sh \ No newline at end of file +CMD ./docker/docker-entrypoint.sh + +FROM base AS ldap +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get install -y --no-install-recommends libldap-dev slapd libsasl2-dev + +FROM base AS mysql +RUN poetry install --with dev --extras "mysql" + +FROM base AS postgres +RUN poetry install --with dev --extras "postgresql" + +FROM ldap AS mysql-ldap +RUN poetry install --with dev --extras "mysql ldap" + +FROM ldap AS postgres-ldap +RUN poetry install --with dev --extras "postgresql ldap" \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index f9ea6440..e27b711d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,7 +15,9 @@ services: - POSTGRES_PASSWORD=postgres re2o: - build: . + build: + context: . + target: postgres volumes: - .:/code ports: diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 3b0a395d..e80a8a5e 100755 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -12,6 +12,9 @@ if [ "$AUTOMIGRATE" != "skip" ]; then poetry run python manage.py migrate --noinput fi +poetry run python manage.py collectstatic +poetry run python manage.py compilemessages + cat <