From f8bee3553d14a83349ab1eb4c5dcb576e65fb058 Mon Sep 17 00:00:00 2001 From: Stephan Porada Date: Wed, 4 Sep 2019 14:51:46 +0200 Subject: [PATCH] =?UTF-8?q?Dockerize=20opaque=20flask=20app=20with=20docke?= =?UTF-8?q?r-compose=20=E2=80=93=20first=20step?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 18 ++++++++++++++++++ docker-compose.yml | 14 ++++++++++++++ flask-entrypoint.sh | 3 +++ opaque.py | 2 +- 4 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 flask-entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..e6a7ea0b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +# pull official base image +FROM python:3.6.9 + +# set environment varibles +ENV PYTHONDONTWRITEBYTECODE 1 +ENV PYTHONUNBUFFERED 1 + +# set work directory +WORKDIR /opaque + +# Copy the current directory contents into the container at /daemon +COPY . /opaque + +# Install requirements +RUN pip install --trusted-host pypi.python.org -r requirements.txt + +# set permissions for entrypoint +RUN chmod a+x flask-entrypoint.sh diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..996d29a2 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3.7' + +services: + web: + build: . + container_name: web_flask_opaque + image: gitlab.ub.uni-bielefeld.de:4567/sfb1288inf/opaque + volumes: + - .:/opaque + env_file: + - .env + ports: + - 5000:5000 + command: bash flask-entrypoint.sh diff --git a/flask-entrypoint.sh b/flask-entrypoint.sh new file mode 100644 index 00000000..ed4b193f --- /dev/null +++ b/flask-entrypoint.sh @@ -0,0 +1,3 @@ +#!/bin/bash -x + +python opaque.py diff --git a/opaque.py b/opaque.py index 55b41b8c..3f8483af 100644 --- a/opaque.py +++ b/opaque.py @@ -31,4 +31,4 @@ def test(): if __name__ == '__main__': - socketio.run(app) + socketio.run(app, host='0.0.0.0')