Adding Dockerfile
- Adds Dockerfile to help deployment - Updated README Change-Id: Ia93a83083a89e9e6ad1a958dc67ac90ef27cae5a
This commit is contained in:
parent
6d7de5c2b2
commit
4c320ad883
25
Dockerfile
Normal file
25
Dockerfile
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Dockerfile for ailuropoda
|
||||||
|
# Created 2016-06-02
|
||||||
|
# Author: JJ Asghar <jj@chef.io>
|
||||||
|
#
|
||||||
|
|
||||||
|
# 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" ]
|
19
README.md
19
README.md
@ -2,5 +2,20 @@
|
|||||||
|
|
||||||
This project is to create a "sad panda" api.
|
This project is to create a "sad panda" api.
|
||||||
|
|
||||||
- v1 will give you back a jpg of a sad panda from a list.
|
- v1 will give you back a jpg of a sad panda at location: http://localhost:1901/v1/sad_panda01.png
|
||||||
- v2 we are planning for a random "sad panda" image
|
|
||||||
|
## 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.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user