Skip to content
Permalink
Browse files

added Docker

  • Loading branch information
gfrogat committed Oct 1, 2018
1 parent ce9a893 commit 16935eb69fff34d8d8e0cddcacaed08119b13c69
Showing with 88 additions and 0 deletions.
  1. +31 −0 .dockerignore
  2. +16 −0 tools/docker/Dockerfile
  3. +21 −0 tools/docker/README.md
  4. +20 −0 tools/docker/dev.Dockerfile
@@ -0,0 +1,31 @@
# Git / Github
.git
.github

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# ConfusionFlow project
examples
logs
tools

# UI component and node_modules
**/node_modules
ui
@@ -0,0 +1,16 @@
FROM alpine:3.8

LABEL MAINTAINER Peter Ruch <gfrogat@gmail.com>

RUN apk add --no-cache python3 py3-gevent

COPY . /opt/app
WORKDIR /opt/app

RUN python3 setup.py install

ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8

EXPOSE 80
CMD [ "confusionflow", "--logdir=/logs", "--host=0.0.0.0", "--port=80"]
@@ -0,0 +1,21 @@
## Docker

### Building Container
Make sure that the UI component is already built before building the Docker containers (the containers size will blow up otherwise to the `node_modules`).
```
# UI component
python setup.py build_ui
# Development
docker build . -f tools/docker/dev.Dockerfile -t confusionflow-dev
# Production
docker build . -f tools/docker/Dockerfile -t confusionflow
```


### Usage

```
docker run --rm -p 8080:80 -v <path_to_logdir>:/logs -ti confusionflow/confusionflow:latest
```
@@ -0,0 +1,20 @@
FROM alpine:3.8

LABEL MAINTAINER Peter Ruch <gfrogat@gmail.com>

RUN apk add --no-cache python3 py3-gevent

COPY . /opt/app
WORKDIR /opt/app

RUN python3 setup.py build develop

ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8

ENV FLASK_APP=confusionflow
ENV FLASK_ENV=development
ENV CONFUSIONFLOW_LOGDIR=/logs

EXPOSE 80
CMD [ "flask", "run", "--host=0.0.0.0", "--port=80"]

0 comments on commit 16935eb

Please sign in to comment.
You can’t perform that action at this time.