lemur/docker/Dockerfile

92 lines
2.0 KiB
Docker
Raw Normal View History

2018-12-30 00:04:13 +01:00
FROM alpine:3.8 as builder
ENV VERSION master
#ENV VERSION 0.7.0
2018-12-30 21:37:09 +01:00
ENV uid 1337
ENV gid 1337
ENV user lemur
ENV group lemur
#RUN adduser -D -S -u ${uid} ${user} -G ${group}
RUN addgroup -S ${group} -g ${gid} && adduser -D -S ${user} -G ${group} -u ${uid}
2018-12-30 00:04:13 +01:00
RUN apk --update add python3
RUN apk --update add --virtual build-dependencies \
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 \
openldap-dev
#RUN git clone https://github.com/Netflix/lemur
RUN mkdir -p /opt/lemur && curl -sSL https://github.com/Netflix/lemur/archive/$VERSION.tar.gz | tar xz -C /opt/lemur --strip-components=1
RUN ls -lha /opt/lemur/
WORKDIR /opt/lemur
2018-12-30 21:37:09 +01:00
RUN npm install --unsafe-perm
2018-12-30 00:04:13 +01:00
RUN pip3 install --upgrade pip
RUN pip3 install setuptools
RUN pip3 install -e .
2018-12-30 21:37:09 +01:00
#RUN node_modules/.bin/gulp build --urlContextPath=/arnold/foo
2018-12-30 00:04:13 +01:00
RUN node_modules/.bin/gulp build
2018-12-30 21:37:09 +01:00
#RUN node_modules/.bin/gulp build -h
2018-12-30 00:04:13 +01:00
RUN node_modules/.bin/gulp package --urlContextPath=$(urlContextPath)
RUN apk del build-dependencies
2018-12-30 21:37:09 +01:00
2018-12-30 00:04:13 +01:00
#####################
2018-12-30 21:37:09 +01:00
RUN apk add --update libldap postgresql-client bash nginx supervisor curl
#RUN python3 /opt/lemur/lemur/manage.py reset_password -u lemur
2018-12-30 00:04:13 +01:00
RUN mkdir -p /run/nginx/
WORKDIR /
COPY entrypoint /
RUN chmod +x /entrypoint
2018-12-30 21:37:09 +01:00
#RUN mkdir -p /conf
COPY lemur.py /conf/lemur.conf.py
2018-12-30 00:04:13 +01:00
COPY supervisor.conf /
COPY default.conf /etc/nginx/conf.d/
2018-12-30 21:37:09 +01:00
HEALTHCHECK --interval=12s --timeout=12s --start-period=30s \
CMD curl --fail http://localhost:80/api/1/healthcheck |grep -q ok || exit 1
2018-12-30 00:04:13 +01:00
ENTRYPOINT ["/entrypoint"]
2018-12-30 21:37:09 +01:00
#CMD ["python3","/lemur/lemur/manage.py","start","-b","0.0.0.0:8000"]
2018-12-30 00:04:13 +01:00
CMD ["/usr/bin/supervisord","-c","supervisor.conf"]