Update Dockerfile to better pattern
Add requirements layer Add entrypoint.sh script to support future CLI Change Dockerfile to use ENTRYPOINT
This commit is contained in:
parent
0a29beff5c
commit
4efe40d184
29
Dockerfile
29
Dockerfile
|
@ -13,20 +13,37 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
FROM ubuntu:16.04
|
FROM ubuntu:16.04
|
||||||
|
|
||||||
|
ARG VERSION
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND noninteractive
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
ENV container docker
|
ENV container docker
|
||||||
|
|
||||||
RUN apt -qq update && \
|
RUN apt -qq update && \
|
||||||
apt -y install git netbase python3-minimal python3-setuptools python3-pip python3-dev ca-certificates gcc g++ make libffi-dev libssl-dev --no-install-recommends
|
apt -y install git \
|
||||||
|
netbase \
|
||||||
|
python3-minimal \
|
||||||
|
python3-setuptools \
|
||||||
|
python3-pip \
|
||||||
|
python3-dev \
|
||||||
|
ca-certificates \
|
||||||
|
gcc \
|
||||||
|
g++ \
|
||||||
|
make \
|
||||||
|
libffi-dev \
|
||||||
|
libssl-dev --no-install-recommends
|
||||||
|
|
||||||
# Need to configure proxies?
|
# Copy direct dependency requirements only to build a dependency layer
|
||||||
|
COPY ./requirements-direct.txt /tmp/drydock/
|
||||||
RUN git clone https://github.com/sh8121att/drydock /tmp/drydock
|
RUN pip3 install -r /tmp/drydock/requirements-direct.txt
|
||||||
|
|
||||||
|
COPY . /tmp/drydock
|
||||||
WORKDIR /tmp/drydock
|
WORKDIR /tmp/drydock
|
||||||
|
|
||||||
RUN python3 setup.py install
|
RUN python3 setup.py install
|
||||||
|
|
||||||
EXPOSE 9000
|
EXPOSE 9000
|
||||||
|
|
||||||
CMD ["/usr/bin/uwsgi","--http",":9000","-w","drydock_provisioner.drydock","--callable","drydock","--enable-threads","-L"]
|
COPY examples/drydock.conf /etc/drydock/drydock.conf
|
||||||
|
|
||||||
|
ENTRYPOINT ["./entrypoint.sh"]
|
||||||
|
|
||||||
|
CMD ["server"]
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
CMD="drydock"
|
||||||
|
PORT="8000"
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ "$1" = 'server' ]; then
|
||||||
|
exec uwsgi --http :${PORT} -w drydock_provisioner.drydock --callable drydock --enable-threads -L --pyargv "--config-file /etc/drydock/drydock.conf"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec ${CMD} $@
|
|
@ -0,0 +1,10 @@
|
||||||
|
PyYAML
|
||||||
|
pyghmi>=1.0.18
|
||||||
|
netaddr
|
||||||
|
falcon
|
||||||
|
oslo.versionedobjects>=1.23.0
|
||||||
|
requests
|
||||||
|
oauthlib
|
||||||
|
uwsgi>1.4
|
||||||
|
bson===0.4.7
|
||||||
|
oslo.config
|
|
@ -1,5 +0,0 @@
|
||||||
PyYAML==3.12
|
|
||||||
oauth==1.0.1
|
|
||||||
requests-oauthlib==0.8.0
|
|
||||||
netaddr==0.7.19
|
|
||||||
python-libmaas==0.4.1
|
|
Loading…
Reference in New Issue