Browse Source

Adding Dockerfile

- Adds Dockerfile to help deployment
- Updated README

Change-Id: Ia93a83083a89e9e6ad1a958dc67ac90ef27cae5a
changes/37/324637/1
JJ Asghar 3 years ago
parent
commit
4c320ad883
2 changed files with 42 additions and 2 deletions
  1. 25
    0
      Dockerfile
  2. 17
    2
      README.md

+ 25
- 0
Dockerfile View File

@@ -0,0 +1,25 @@
1
+# Dockerfile for ailuropoda
2
+# Created 2016-06-02
3
+# Author: JJ Asghar <jj@chef.io>
4
+#
5
+
6
+# Pull down a standard python container
7
+FROM python:2.7.11-alpine
8
+
9
+# Create the place for the application
10
+RUN mkdir -p /usr/src/app
11
+
12
+# Do your work in that place
13
+WORKDIR /usr/src/app
14
+
15
+# Copy the requirements.txt to get dependencies
16
+COPY requirements.txt /usr/src/app/
17
+
18
+# Get the dependencies
19
+RUN pip  install -v -r   requirements.txt
20
+
21
+# Copy the file into the working directory
22
+COPY . /usr/src/app
23
+
24
+# Make the pandas cry
25
+CMD [ "python", "./main.py" ]

+ 17
- 2
README.md View File

@@ -2,5 +2,20 @@
2 2
 
3 3
 This project is to create a "sad panda" api.
4 4
 
5
-- v1 will give you back a jpg of a sad panda from a list.
6
-- v2 we are planning for a random "sad panda" image
5
+- v1 will give you back a jpg of a sad panda at location: http://localhost:1901/v1/sad_panda01.png
6
+
7
+## Deployment
8
+
9
+### Dockerfile
10
+
11
+For your convenience there is [Dockerfile](./Dockerfile) located in this directory.
12
+You can start up this application assuming you have Docker installed via:
13
+
14
+```bash
15
+$ docker build -t sadpanda .
16
+$ docker run -it  -p 1901:1901 --rm --name sadpanda sadpanda
17
+```
18
+
19
+This will give you a Docker container named sadpanda and start it on port `1901`.
20
+
21
+Go to: http://DOCKERHOST:1901/v1/sad_panda01.png to see the image.

Loading…
Cancel
Save