<\/span><\/h2>\nNext lets look at the docker file.<\/p>\n
Within the Dockerfile, we add the necessary instructions, to the end of the file, to copy over the previously created script and assign it against the ENTRYPOINT instruction.<\/p>\n
WORKDIR $CONTAINER_PROJECT\r\nCOPY .\/entrypoint-main.sh \/\r\nENTRYPOINT [\"\/entrypoint.sh\"]<\/pre>\nHere is the Dockerfile, in its entirety.<\/p>\n
# Set the base image to Ubuntu\r\nFROM ubuntu:14.04\r\n\r\n# File Author \/ Maintainer\r\nMAINTAINER Maintaner Ricky Donato\r\n\r\n# Update the default application repository sources list\r\nRUN apt-get update && apt-get install -y \\\r\n python-dev \\\r\n python \\\r\n python-pip \\\r\n python-setuptools \\\r\n build-essential \\\r\n python-dev \\\r\n git\r\n\r\n# Set variables for project name, and where to place files in container.\r\nENV PROJECT=projectx\r\nENV CONTAINER_HOME=\/opt\r\nENV CONTAINER_PROJECT=$CONTAINER_HOME\/$PROJECT\r\n\r\n# Create application subdirectories\r\nWORKDIR $CONTAINER_HOME\r\nRUN mkdir logs\r\n\r\n# Copy application source code to $CONTAINER_PROJECT\r\nCOPY . $CONTAINER_PROJECT\r\n\r\n# Install Python dependencies\r\nRUN pip install -r $CONTAINER_PROJECT\/requirements.txt\r\nRUN pip install gunicorn\r\n\r\n# Copy and set entrypoint\r\nWORKDIR $CONTAINER_PROJECT\r\nCOPY .\/entrypoint.sh \/\r\nENTRYPOINT [\"\/entrypoint.sh\"]<\/pre>\n