Add Dockerfile and entrypoint script

This commit is contained in:
Jan Dittberner 2020-03-03 12:22:45 +01:00
parent 34f788e099
commit 628d6ee550
2 changed files with 52 additions and 0 deletions

45
Dockerfile Normal file
View file

@ -0,0 +1,45 @@
ARG DEBIAN_RELEASE=buster
FROM debian:$DEBIAN_RELEASE
LABEL maintainer="Jan Dittberner <jan@dittberner.info>"
ARG GVALDAPGID=2000
ARG GVALDAPUID=2000
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
dumb-init \
gettext \
git \
libldap2-dev \
libsasl2-dev \
python3-dev \
python3-pip \
python3-setuptools \
python3-virtualenv \
python3-wheel \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*.*
WORKDIR /srv/gvaldap
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
RUN python3 -m pip install --prefix=/usr/local pipenv
COPY Pipfile Pipfile.lock /srv/gvaldap/
RUN addgroup --gid $GVALDAPGID gvaldap ; \
adduser --home /home/gvaldap --shell /bin/bash --uid $GVALDAPUID --gid $GVALDAPGID --disabled-password --gecos "Gnuviechadmin LDAP user" gvaldap
USER gvaldap
RUN python3 -m virtualenv --python=python3 /home/gvaldap/gvaldap-venv ; \
/home/gvaldap/gvaldap-venv/bin/python3 -m pip install -U pip ; \
VIRTUAL_ENV=/home/gvaldap/gvaldap-venv pipenv install --deploy --ignore-pipfile --dev
VOLUME /srv/gvaldap
COPY gvaldap.sh /srv/
ENTRYPOINT ["dumb-init", "/srv/gvaldap.sh"]

7
gvaldap.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
set -e
. /home/gvaldap/gvaldap-venv/bin/activate
cd /srv/gvaldap/gvaldap
celery -A ldaptasks worker -Q ldap -l info