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
842ad35bb8
29
Dockerfile
29
Dockerfile
@ -13,20 +13,37 @@
|
||||
# limitations under the License.
|
||||
FROM ubuntu:16.04
|
||||
|
||||
ARG VERSION
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV container docker
|
||||
|
||||
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?
|
||||
|
||||
RUN git clone https://github.com/sh8121att/drydock /tmp/drydock
|
||||
# Copy direct dependency requirements only to build a dependency layer
|
||||
COPY ./requirements-direct.txt /tmp/drydock/
|
||||
RUN pip3 install -r /tmp/drydock/requirements-direct.txt
|
||||
|
||||
COPY . /tmp/drydock
|
||||
WORKDIR /tmp/drydock
|
||||
|
||||
RUN python3 setup.py install
|
||||
|
||||
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"]
|
||||
|
12
entrypoint.sh
Executable file
12
entrypoint.sh
Executable file
@ -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} $@
|
10
requirements-direct.txt
Normal file
10
requirements-direct.txt
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user