From abb76836a1348d89b1f0852e164ee67faa98d37b Mon Sep 17 00:00:00 2001 From: Notisset Date: Tue, 26 Sep 2017 00:52:06 +0200 Subject: [PATCH] Added Docker + docker-compose configuration --- .dockerignore | 2 ++ Dockerfile | 12 ++++++++++++ docker-compose.yml | 10 ++++++++++ docs/config_core/core_docker_sqlite.ini | 11 +++++++++++ requirements.txt | 2 +- 5 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 docs/config_core/core_docker_sqlite.ini diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..389959e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.git +.idea \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fdecd17 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM alpine:latest +MAINTAINER Notisset + +RUN apk update && apk add musl-dev zlib-dev jpeg-dev gcc python3 python3-dev + +COPY requirements.txt . +RUN pip3 install -r requirements.txt + +COPY . /var/www/site + +EXPOSE 8080 +ENTRYPOINT python3 /var/www/site/web.py diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..c67e05d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: '2' +services: + app: + build: . + restart: always + ports: + - "8080:8080" + volumes: + - .:/var/www/site + working_dir: /var/www/site diff --git a/docs/config_core/core_docker_sqlite.ini b/docs/config_core/core_docker_sqlite.ini new file mode 100644 index 0000000..b528b59 --- /dev/null +++ b/docs/config_core/core_docker_sqlite.ini @@ -0,0 +1,11 @@ +[GENERAL] +Address = 0.0.0.0 +Port = 8080 + +[DATABASE] +Engine = sqlite +Path = pos.db + +[PRINTER] +Host = 192.168.1.100 +Post = 9100 diff --git a/requirements.txt b/requirements.txt index 1d47eea..74c6f33 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ aiohttp click>=6.0 -SQLAlchemy>=1.2.0 +SQLAlchemy>=1.2.0b1 sqlalchemy_utils>=0.32.00 pymysql passlib