Update Dockerfile
This commit is contained in:
parent
6d5782b44c
commit
5567bb2eaa
|
@ -1,20 +1,22 @@
|
||||||
FROM alpine:3.8 as builder
|
FROM alpine:3.8
|
||||||
|
|
||||||
|
ARG VERSION
|
||||||
ENV VERSION master
|
ENV VERSION master
|
||||||
#ENV VERSION 0.7.0
|
|
||||||
|
|
||||||
ENV uid 1337
|
ENV uid 1337
|
||||||
ENV gid 1337
|
ENV gid 1337
|
||||||
ENV user lemur
|
ENV user lemur
|
||||||
ENV group lemur
|
ENV group lemur
|
||||||
|
|
||||||
#RUN adduser -D -S -u ${uid} ${user} -G ${group}
|
COPY entrypoint /
|
||||||
|
COPY lemur.conf.py /conf/lemur.conf.py
|
||||||
|
COPY supervisor.conf /
|
||||||
|
COPY default.conf /etc/nginx/conf.d/
|
||||||
|
|
||||||
RUN addgroup -S ${group} -g ${gid} && adduser -D -S ${user} -G ${group} -u ${uid}
|
RUN addgroup -S ${group} -g ${gid} && \
|
||||||
|
adduser -D -S ${user} -G ${group} -u ${uid} && \
|
||||||
RUN apk --update add python3
|
apk --update add python3 libldap postgresql-client bash nginx supervisor curl && \
|
||||||
|
apk --update add --virtual build-dependencies \
|
||||||
RUN apk --update add --virtual build-dependencies \
|
|
||||||
git \
|
git \
|
||||||
tar \
|
tar \
|
||||||
curl \
|
curl \
|
||||||
|
@ -32,60 +34,28 @@ RUN apk --update add --virtual build-dependencies \
|
||||||
libressl-dev \
|
libressl-dev \
|
||||||
libffi-dev \
|
libffi-dev \
|
||||||
cyrus-sasl-dev \
|
cyrus-sasl-dev \
|
||||||
openldap-dev
|
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 && \
|
||||||
#RUN git clone https://github.com/Netflix/lemur
|
pip3 install --upgrade pip && \
|
||||||
|
pip3 install --upgrade setuptools && \
|
||||||
RUN mkdir -p /opt/lemur && curl -sSL https://github.com/Netflix/lemur/archive/$VERSION.tar.gz | tar xz -C /opt/lemur --strip-components=1
|
chmod +x /entrypoint && \
|
||||||
|
mkdir -p /run/nginx/
|
||||||
RUN ls -lha /opt/lemur/
|
|
||||||
|
|
||||||
WORKDIR /opt/lemur
|
WORKDIR /opt/lemur
|
||||||
|
|
||||||
RUN npm install --unsafe-perm
|
RUN npm install --unsafe-perm && \
|
||||||
|
pip3 install -e . && \
|
||||||
RUN pip3 install --upgrade pip
|
node_modules/.bin/gulp build && \
|
||||||
|
node_modules/.bin/gulp package --urlContextPath=$(urlContextPath) && \
|
||||||
RUN pip3 install setuptools
|
apk del build-dependencies
|
||||||
RUN pip3 install -e .
|
|
||||||
|
|
||||||
#RUN node_modules/.bin/gulp build --urlContextPath=/arnold/foo
|
|
||||||
|
|
||||||
RUN node_modules/.bin/gulp build
|
|
||||||
|
|
||||||
#RUN node_modules/.bin/gulp build -h
|
|
||||||
|
|
||||||
RUN node_modules/.bin/gulp package --urlContextPath=$(urlContextPath)
|
|
||||||
|
|
||||||
RUN apk del build-dependencies
|
|
||||||
|
|
||||||
|
|
||||||
#####################
|
|
||||||
|
|
||||||
RUN apk add --update libldap postgresql-client bash nginx supervisor curl
|
|
||||||
|
|
||||||
#RUN python3 /opt/lemur/lemur/manage.py reset_password -u lemur
|
|
||||||
|
|
||||||
RUN mkdir -p /run/nginx/
|
|
||||||
|
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
|
|
||||||
COPY entrypoint /
|
|
||||||
|
|
||||||
RUN chmod +x /entrypoint
|
|
||||||
|
|
||||||
#RUN mkdir -p /conf
|
|
||||||
|
|
||||||
COPY lemur.py /conf/lemur.conf.py
|
|
||||||
|
|
||||||
COPY supervisor.conf /
|
|
||||||
COPY default.conf /etc/nginx/conf.d/
|
|
||||||
|
|
||||||
HEALTHCHECK --interval=12s --timeout=12s --start-period=30s \
|
HEALTHCHECK --interval=12s --timeout=12s --start-period=30s \
|
||||||
CMD curl --fail http://localhost:80/api/1/healthcheck | grep -q ok || exit 1
|
CMD curl --fail http://localhost:80/api/1/healthcheck | grep -q ok || exit 1
|
||||||
|
|
||||||
|
USER lemur
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint"]
|
ENTRYPOINT ["/entrypoint"]
|
||||||
|
|
||||||
#CMD ["python3","/lemur/lemur/manage.py","start","-b","0.0.0.0:8000"]
|
|
||||||
|
|
||||||
CMD ["/usr/bin/supervisord","-c","supervisor.conf"]
|
CMD ["/usr/bin/supervisord","-c","supervisor.conf"]
|
||||||
|
|
Loading…
Reference in New Issue