From 4c320ad883ace7c44f375220223d73e92b992958 Mon Sep 17 00:00:00 2001 From: JJ Asghar Date: Thu, 2 Jun 2016 11:03:12 -0500 Subject: [PATCH] Adding Dockerfile - Adds Dockerfile to help deployment - Updated README Change-Id: Ia93a83083a89e9e6ad1a958dc67ac90ef27cae5a --- Dockerfile | 25 +++++++++++++++++++++++++ README.md | 19 +++++++++++++++++-- 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..21fc114 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +# Dockerfile for ailuropoda +# Created 2016-06-02 +# Author: JJ Asghar +# + +# Pull down a standard python container +FROM python:2.7.11-alpine + +# Create the place for the application +RUN mkdir -p /usr/src/app + +# Do your work in that place +WORKDIR /usr/src/app + +# Copy the requirements.txt to get dependencies +COPY requirements.txt /usr/src/app/ + +# Get the dependencies +RUN pip install -v -r requirements.txt + +# Copy the file into the working directory +COPY . /usr/src/app + +# Make the pandas cry +CMD [ "python", "./main.py" ] diff --git a/README.md b/README.md index 9550d1b..4f90d47 100644 --- a/README.md +++ b/README.md @@ -2,5 +2,20 @@ This project is to create a "sad panda" api. -- v1 will give you back a jpg of a sad panda from a list. -- v2 we are planning for a random "sad panda" image +- v1 will give you back a jpg of a sad panda at location: http://localhost:1901/v1/sad_panda01.png + +## Deployment + +### Dockerfile + +For your convenience there is [Dockerfile](./Dockerfile) located in this directory. +You can start up this application assuming you have Docker installed via: + +```bash +$ docker build -t sadpanda . +$ docker run -it -p 1901:1901 --rm --name sadpanda sadpanda +``` + +This will give you a Docker container named sadpanda and start it on port `1901`. + +Go to: http://DOCKERHOST:1901/v1/sad_panda01.png to see the image.