Skip to main content

Posts

Showing posts from May, 2020

Copy Pastes from Docker’s Get Started doc

Copy Pastes from Docker’s Get Started doc Create image, manage containers, docker cloud https://docker.github.io/get-started/part2/#log-in-with-your-docker-id Dockerfile Create an empty directory. Change directories ( cd ) into the new directory, create a file called  Dockerfile , copy-and-paste the following content into that file, and save it. Take note of the comments that explain each statement in your new Dockerfile. # Use an official Python runtime as a parent image FROM python: 2 . 7 -slim   # Set the working directory to /app WORKDIR /app   # Copy the current directory contents into the container at /app ADD . /app   # Install any needed packages specified in requirements.txt RUN pip install -r requirements.txt   # Make port 80 available to the world outside this container EXPOSE 80   # Define environment variable ENV NAME World   # Run app.py when the container launches CMD [ "python" , "app.py" ] requirements.txt Flask Redis app.py from flask import Fla