8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-22 03:13:12 +00:00

Update dockerfile structure

This commit is contained in:
chapeau 2024-03-08 10:05:24 +01:00
parent 5554476920
commit fe382783c0
3 changed files with 25 additions and 4 deletions

View file

@ -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
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"

View file

@ -15,7 +15,9 @@ services:
- POSTGRES_PASSWORD=postgres
re2o:
build: .
build:
context: .
target: postgres
volumes:
- .:/code
ports:

View file

@ -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 <<EOF | poetry run python manage.py shell
from django.contrib.auth import get_user_model