lemur/docker/Dockerfile

70 lines
2.0 KiB
Docker
Raw Permalink Normal View History

2021-01-26 08:32:26 +01:00
FROM python:3.7.9-alpine3.12
2018-12-30 00:04:13 +01:00
2018-12-30 21:43:04 +01:00
ARG VERSION
2018-12-30 00:04:13 +01:00
ENV VERSION master
ARG URLCONTEXT
2018-12-30 21:37:09 +01:00
ENV uid 1337
ENV gid 1337
ENV user lemur
ENV group lemur
2018-12-30 21:43:04 +01:00
RUN addgroup -S ${group} -g ${gid} && \
adduser -D -S ${user} -G ${group} -u ${uid} && \
2021-01-26 08:32:26 +01:00
apk add --no-cache --update python3 py-pip libldap postgresql-client nginx supervisor curl tzdata openssl bash && \
2018-12-30 21:43:04 +01:00
apk --update add --virtual build-dependencies \
2018-12-30 00:04:13 +01:00
git \
tar \
curl \
python3-dev \
npm \
bash \
musl-dev \
gcc \
autoconf \
automake \
libtool \
2018-12-30 00:04:13 +01:00
make \
nasm \
zlib-dev \
postgresql-dev \
libressl-dev \
libffi-dev \
cyrus-sasl-dev \
2018-12-30 21:43:04 +01:00
openldap-dev && \
2018-12-30 22:48:28 +01:00
mkdir -p /opt/lemur /home/lemur/.lemur/ && \
curl -sSL https://github.com/Netflix/lemur/archive/$VERSION.tar.gz | tar xz -C /opt/lemur --strip-components=1 && \
2018-12-30 21:43:04 +01:00
pip3 install --upgrade pip && \
pip3 install --upgrade setuptools && \
2018-12-31 15:37:48 +01:00
mkdir -p /run/nginx/ /etc/nginx/ssl/ && \
2018-12-31 17:13:31 +01:00
chown -R $user:$group /opt/lemur/ /home/lemur/.lemur/
2021-01-26 08:32:26 +01:00
2018-12-30 00:04:13 +01:00
WORKDIR /opt/lemur
2021-01-26 08:32:26 +01:00
RUN echo "Running with python:" && python -c 'import platform; print(platform.python_version())' && \
echo "Running with nodejs:" && node -v && \
npm install --unsafe-perm && \
2018-12-30 21:43:04 +01:00
pip3 install -e . && \
node_modules/.bin/gulp build && \
node_modules/.bin/gulp package --urlContextPath=${URLCONTEXT} && \
2018-12-30 21:43:04 +01:00
apk del build-dependencies
2018-12-30 00:04:13 +01:00
COPY entrypoint /
COPY src/lemur.conf.py /home/lemur/.lemur/lemur.conf.py
COPY supervisor.conf /
COPY nginx/default.conf /etc/nginx/conf.d/
COPY nginx/default-ssl.conf /etc/nginx/conf.d/
RUN chmod +x /entrypoint
2018-12-30 00:04:13 +01:00
WORKDIR /
2018-12-30 21:37:09 +01:00
HEALTHCHECK --interval=12s --timeout=12s --start-period=30s \
2018-12-30 21:43:04 +01:00
CMD curl --fail http://localhost:80/api/1/healthcheck | grep -q ok || exit 1
2018-12-30 21:37:09 +01:00
2018-12-30 22:01:28 +01:00
USER root
2018-12-30 00:04:13 +01:00
2018-12-30 21:43:04 +01:00
ENTRYPOINT ["/entrypoint"]
2018-12-30 21:37:09 +01:00
2018-12-30 00:04:13 +01:00
CMD ["/usr/bin/supervisord","-c","supervisor.conf"]