Skip to content

Instantly share code, notes, and snippets.

@cecyc
Last active July 17, 2018 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cecyc/733229fe0ebe506c03c267dd1bdc4ad0 to your computer and use it in GitHub Desktop.
Save cecyc/733229fe0ebe506c03c267dd1bdc4ad0 to your computer and use it in GitHub Desktop.
Dockerfile and docker-compose for a simple Flask app

Dockerfile

FROM python:3.4
RUN apt-get update -y
RUN apt-get install -y python-pip build-essential
COPY ./path-to-app /app
WORKDIR /app
RUN pip install --no-cache-dir -r requirements.txt
ENV FLASK_APP=app.py
ENV FLASK_ENV=development

docker-compose.yml

version: '3'
services:
  app:
    build: 
      context: ..
      dockerfile: ./path-to/Dockerfile
    ports:
    - '5000:5000'
    command: python app.py

requirements.txt

Flask==1.0.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment