lemur/docker/Dockerfile

64 lines
1.7 KiB
Docker
Raw Normal View History

2018-12-30 21:43:04 +01:00
FROM alpine:3.8
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
2018-12-30 21:37:09 +01:00
ENV uid 1337
ENV gid 1337
ENV user lemur
ENV group lemur
2018-12-30 21:44:05 +01:00
2018-12-30 21:43:04 +01:00
COPY entrypoint /
COPY lemur.conf.py /conf/lemur.conf.py
COPY supervisor.conf /
COPY default.conf /etc/nginx/conf.d/
2018-12-30 00:04:13 +01:00
2018-12-30 21:43:04 +01:00
RUN addgroup -S ${group} -g ${gid} && \
adduser -D -S ${user} -G ${group} -u ${uid} && \
apk --update add python3 libldap postgresql-client bash nginx supervisor curl && \
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 \
make \
nasm \
zlib-dev \
postgresql-dev \
libressl-dev \
libffi-dev \
cyrus-sasl-dev \
2018-12-30 21:43:04 +01:00
openldap-dev && \
mkdir -p /opt/lemur && curl -sSL https://github.com/Netflix/lemur/archive/$VERSION.tar.gz | tar xz -C /opt/lemur --strip-components=1 && \
pip3 install --upgrade pip && \
pip3 install --upgrade setuptools && \
chmod +x /entrypoint && \
2018-12-30 21:44:05 +01:00
mkdir -p /run/nginx/ && \
chown -R $user:$group /opt/lemur/
2018-12-30 21:43:04 +01:00
2018-12-30 00:04:13 +01:00
WORKDIR /opt/lemur
2018-12-30 21:43:04 +01:00
RUN npm install --unsafe-perm && \
pip3 install -e . && \
node_modules/.bin/gulp build && \
node_modules/.bin/gulp package --urlContextPath=$(urlContextPath) && \
apk del build-dependencies
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"]