2024-02-11 13:12:26 +01:00
|
|
|
ARG DEBIAN_RELEASE=bookworm
|
2023-02-19 15:53:00 +01:00
|
|
|
FROM debian:$DEBIAN_RELEASE AS builder
|
|
|
|
|
|
|
|
ARG GVAAPP=gva
|
2024-02-11 13:12:26 +01:00
|
|
|
ARG POETRY_VERSION=1.7.1
|
2018-11-19 23:28:40 +01:00
|
|
|
|
2020-03-03 13:10:09 +01:00
|
|
|
ENV LC_ALL=C.UTF-8
|
|
|
|
ENV LANG=C.UTF-8
|
2023-02-19 15:53:00 +01:00
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
2020-03-03 13:10:09 +01:00
|
|
|
|
2018-11-19 23:28:40 +01:00
|
|
|
RUN apt-get update \
|
2023-02-19 15:53:00 +01:00
|
|
|
&& apt-get install -y --no-install-recommends \
|
|
|
|
build-essential \
|
|
|
|
curl \
|
|
|
|
git \
|
|
|
|
libpq-dev \
|
|
|
|
python3-dev \
|
|
|
|
python3-setuptools \
|
|
|
|
python3-virtualenv \
|
|
|
|
python3-wheel
|
|
|
|
|
|
|
|
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/root/.local POETRY_VERSION=$POETRY_VERSION python3 - \
|
|
|
|
&& /root/.local/bin/poetry config virtualenvs.in-project true
|
|
|
|
|
|
|
|
WORKDIR /srv/$GVAAPP
|
|
|
|
|
|
|
|
COPY poetry.lock pyproject.toml /srv/$GVAAPP/
|
2018-11-19 23:28:40 +01:00
|
|
|
|
2024-02-11 13:12:26 +01:00
|
|
|
RUN /root/.local/bin/poetry install --only=main --no-root
|
2023-02-19 15:53:00 +01:00
|
|
|
|
|
|
|
FROM debian:$DEBIAN_RELEASE
|
|
|
|
LABEL maintainer="Jan Dittberner <jan@dittberner.info>"
|
2018-11-19 23:28:40 +01:00
|
|
|
|
2023-02-19 17:48:25 +01:00
|
|
|
ENV LC_ALL=C.UTF-8
|
|
|
|
ENV LANG=C.UTF-8
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
2020-03-03 13:10:09 +01:00
|
|
|
RUN apt-get update \
|
2023-02-19 15:53:00 +01:00
|
|
|
&& apt-get install -y --no-install-recommends \
|
|
|
|
ca-certificates \
|
|
|
|
dumb-init \
|
|
|
|
gettext \
|
|
|
|
postgresql-client \
|
|
|
|
python3 \
|
|
|
|
python3-pip \
|
|
|
|
python3-wheel \
|
2020-03-03 13:10:09 +01:00
|
|
|
&& apt-get clean \
|
2023-02-19 15:53:00 +01:00
|
|
|
&& rm -rf /var/cache/apt/archives /var/lib/apt/lists/*
|
2020-03-03 13:10:09 +01:00
|
|
|
|
2023-02-19 15:53:00 +01:00
|
|
|
ARG GVAAPP=gva
|
2020-03-03 13:10:09 +01:00
|
|
|
ARG GVAGID=2000
|
|
|
|
ARG GVAUID=2000
|
2018-11-19 23:28:40 +01:00
|
|
|
|
2020-03-03 13:10:09 +01:00
|
|
|
RUN addgroup --gid $GVAGID $GVAAPP ; \
|
2023-02-19 15:53:00 +01:00
|
|
|
adduser --home /home/$GVAAPP --shell /bin/bash --uid $GVAUID --gid $GVAGID --disabled-password \
|
|
|
|
--gecos "User for gnuviechadmin component $GVAAPP" $GVAAPP
|
|
|
|
|
|
|
|
COPY --chown=$GVAAPP:$GVAAPP --from=builder /srv/$GVAAPP/.venv /srv/$GVAAPP/.venv
|
2020-03-03 13:10:09 +01:00
|
|
|
|
2023-02-20 15:39:14 +01:00
|
|
|
WORKDIR /srv/$GVAAPP
|
|
|
|
|
|
|
|
VOLUME /srv/$GVAAPP/media /srv/$GVAAPP/static
|
2020-03-03 13:10:09 +01:00
|
|
|
|
2023-02-20 15:39:14 +01:00
|
|
|
VOLUME /srv/$GVAAPP/gnuviechadmin
|
2019-07-05 21:23:24 +02:00
|
|
|
|
2018-11-19 23:28:40 +01:00
|
|
|
EXPOSE 8000
|
|
|
|
|
2023-02-20 15:39:14 +01:00
|
|
|
COPY ${GVAAPP}.sh entrypoint.sh /srv/
|
2020-03-03 13:10:09 +01:00
|
|
|
|
2023-02-20 15:39:14 +01:00
|
|
|
ENTRYPOINT ["dumb-init", "/srv/entrypoint.sh"]
|