October 29, 2018

Docker Get Started

Here is an example of running a flask app in docker. Write the Dockerfile # Use an official Python runtime as a parent imageFROMpython:2.7-slim# Set the working directory to /appWORKDIR/app# Copy the current directory contents into the container at /appCOPY . /app# Install any needed packages specified in requirements.txtRUN pip install --trusted-host pypi.python.org -r requirements.txt# Make port 80 available to the world outside this containerEXPOSE80# Define environment variableENV NAME World# Run app. Read more

2022 © Evan Lau