From f77da9cfc5add242a4994581bf678b8be2c2750d Mon Sep 17 00:00:00 2001 From: Dmitry Chumak Date: Tue, 6 Jun 2023 16:51:35 +0300 Subject: [PATCH] added docker files --- Dockerfile | 17 +++++++++++++++++ docker-compose.yml | 10 ++++++++++ main.py | 2 +- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..61e0b07 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +# Pull base image +FROM python:3.10 + +# Set environment varibles +ENV PYTHONDONTWRITEBYTECODE 1 +ENV PYTHONUNBUFFERED 1 + +WORKDIR /code/ + +# Install dependencies +RUN pip install pipenv +COPY Pipfile Pipfile.lock /code/ +RUN pipenv install --system --dev + +COPY . /code/ + +EXPOSE 8080 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..431d0c0 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: "3" + +services: + web: + build: . + command: "python main.py" + volumes: + - .:/code + ports: + - "8080:8080" diff --git a/main.py b/main.py index abf9b33..50606e6 100644 --- a/main.py +++ b/main.py @@ -22,4 +22,4 @@ def index(scene, char_name): def server_static(filename): return static_file(filename, root='results') -run(host='localhost', port=8080) +run(host='0.0.0.0', port=8080)