gvaldap/Dockerfile

53 lines
1.4 KiB
Docker
Raw Permalink Normal View History

2020-03-03 12:22:45 +01:00
ARG DEBIAN_RELEASE=buster
FROM debian:$DEBIAN_RELEASE
LABEL maintainer="Jan Dittberner <jan@dittberner.info>"
2020-03-03 13:12:41 +01:00
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
2020-03-03 12:22:45 +01:00
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/*.*
2020-03-03 13:12:41 +01:00
RUN python3 -m pip install --prefix=/usr/local pipenv
2020-03-03 12:22:45 +01:00
2020-03-03 13:12:41 +01:00
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
libldap2-dev \
libsasl2-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*.*
2020-03-03 12:22:45 +01:00
2020-03-03 13:12:41 +01:00
ARG GVAGID=2000
ARG GVAUID=2000
ARG GVAAPP=gvaldap
WORKDIR /srv/$GVAAPP
2020-03-03 12:22:45 +01:00
2020-03-03 13:12:41 +01:00
COPY Pipfile Pipfile.lock /srv/$GVAAPP/
2020-03-03 12:22:45 +01:00
2020-03-03 13:12:41 +01:00
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
2020-03-03 12:22:45 +01:00
2020-03-03 13:12:41 +01:00
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
2020-03-03 12:22:45 +01:00
2020-03-03 13:12:41 +01:00
VOLUME /srv/$GVAAPP
2020-03-03 12:22:45 +01:00
COPY gvaldap.sh /srv/
2020-03-03 13:12:41 +01:00
ENTRYPOINT ["dumb-init", "/srv/gvaldap.sh"]