layerindex-web/Dockerfile
Paul Eggleton 5ee59b1564 docker: dockerfile cleanups
* Use LABEL instead of the deprecated MAINTAINER

* Use COPY instead of ADD. There's no difference in operation here, it's
  just that we don't need the extra magic that ADD provides and best
  practice is to use COPY in that case.

* Fix the mkdir /opt/workdir line - it wasn't being run since it was a
  CMD not RUN, and thus was overridden by a later CMD directive.

* Drop the CMD line to run celery - having more than one CMD directive
  does not work. We'll launch a separate container to run it instead.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-07-23 08:40:00 +02:00

1.2 KiB

FROM buildpack-deps:latest LABEL maintainer="Michael Halstead mhalstead@linuxfoundation.org"

EXPOSE 80 ENV PYTHONUNBUFFERED 1

Uncomment to set proxy ENVVARS within container

#ENV http_proxy http://your.proxy.server:port #ENV https_proxy https://your.proxy.server:port

RUN apt-get update RUN apt-get install -y --no-install-recommends
python-pip
python-mysqldb
python-dev
python-imaging
rabbitmq-server
netcat-openbsd
vim
&& rm -rf /var/lib/apt/lists/* RUN pip install --upgrade pip RUN pip install gunicorn RUN pip install setuptools RUN mkdir /opt/workdir COPY . /opt/layerindex RUN pip install -r /opt/layerindex/requirements.txt COPY settings.py /opt/layerindex/settings.py COPY docker/updatelayers.sh /opt/updatelayers.sh COPY docker/migrate.sh /opt/migrate.sh

Uncomment to add a .gitconfig file within container

#COPY docker/.gitconfig /root/.gitconfig

Uncomment to add a proxy script within container, if you choose to

do so, you will also have to edit .gitconfig appropriately

#COPY docker/git-proxy /opt/bin/git-proxy

Start Gunicorn

CMD ["/usr/local/bin/gunicorn", "wsgi:application", "--workers=4", "--bind=:5000", "--log-level=debug", "--chdir=/opt/layerindex"]