Jan Dittberner
0bf37d1bea
Add gvaweb and gvaldap containers to docker-compose.yml. Unify most of Dockerfile with gvaweb and gvaldap. Add empty directories for mounting asset and media files into bind mounted docker volumes. Run application as separate system user.
56 lines
1.4 KiB
Docker
56 lines
1.4 KiB
Docker
ARG DEBIAN_RELEASE=buster
|
|
FROM debian:$DEBIAN_RELEASE
|
|
LABEL maintainer="Jan Dittberner <jan@dittberner.info>"
|
|
|
|
ENV LC_ALL=C.UTF-8
|
|
ENV LANG=C.UTF-8
|
|
|
|
RUN apt-get update \
|
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
|
build-essential \
|
|
dumb-init \
|
|
gettext \
|
|
git \
|
|
python3-dev \
|
|
python3-pip \
|
|
python3-setuptools \
|
|
python3-virtualenv \
|
|
python3-wheel \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*.*
|
|
|
|
RUN python3 -m pip install --prefix=/usr/local pipenv
|
|
|
|
RUN apt-get update \
|
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
|
libpq-dev \
|
|
postgresql-client \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*.*
|
|
|
|
ARG GVAGID=2000
|
|
ARG GVAUID=2000
|
|
|
|
ARG GVAAPP=gva
|
|
|
|
VOLUME /srv/$GVAAPP/media /srv/$GVAAPP/static
|
|
|
|
WORKDIR /srv/$GVAAPP
|
|
|
|
COPY Pipfile Pipfile.lock /srv/$GVAAPP/
|
|
|
|
RUN addgroup --gid $GVAGID $GVAAPP ; \
|
|
adduser --home /home/$GVAAPP --shell /bin/bash --uid $GVAUID --gid $GVAGID --disabled-password --gecos "User for gnuviechadmin component $GVAAPP" $GVAAPP
|
|
|
|
USER $GVAAPP
|
|
RUN python3 -m virtualenv --python=python3 /home/$GVAAPP/$GVAAPP-venv ; \
|
|
/home/$GVAAPP/$GVAAPP-venv/bin/python3 -m pip install -U pip ; \
|
|
VIRTUAL_ENV=/home/$GVAAPP/$GVAAPP-venv pipenv install --deploy --ignore-pipfile --dev
|
|
|
|
VOLUME /srv/$GVAAPP
|
|
|
|
EXPOSE 8000
|
|
|
|
COPY gva.sh /srv/
|
|
|
|
ENTRYPOINT ["dumb-init", "/srv/gva.sh"]
|