From d456b8668f169c7984feff1ca08886b9c4390a60 Mon Sep 17 00:00:00 2001 From: tinpee Date: Mon, 17 Oct 2016 09:01:26 +0700 Subject: [PATCH] add docker file --- Dockerfile | 11 +++++++++++ README.md | 9 ++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..4c182252 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM python +MAINTAINER Tinpee + +ADD . /src +WORKDIR /src +RUN pip install flask gunicorn \ + && cp cards-jwasham.db cards.db + +CMD ["gunicorn", "--bind", " 0.0.0.0:8000", "flash_cards:app"] + + diff --git a/README.md b/README.md index 5f598783..1def8204 100644 --- a/README.md +++ b/README.md @@ -52,4 +52,11 @@ It uses: 1. When you're ready to start memorizing, click either "General" or "Code" in the top menu. -*Happy learning!* \ No newline at end of file +## How to run with Docker +__Make sure you already installed [docker](https://www.docker.com)__ +- Clone project to any where you want and go to source folder +- Build image: `docker build . -t cs-flash-cards` +- Run container: `docker run -d -p 8000:8000 --name cs-flash-cards cs-flash-cards` +- Go your browser and type `http://localhost:8000` + +*Happy learning!*