From a22dcba77c7850aba1ff0992c4e53e9251126912 Mon Sep 17 00:00:00 2001 From: Chris Speck Date: Mon, 13 Aug 2018 23:13:13 +1000 Subject: [PATCH] Docker files for ease of development on PCs/macs --- Dockerfile | 14 ++++++++++++++ README.md | 15 +++++++++++++++ docker-compose.yml | 9 +++++++++ 3 files changed, 38 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ff2bfe5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +# Dockerfile for development on a pc/mac +FROM python:2 + +EXPOSE 5000 + +WORKDIR /usr/src/app + +COPY requirements.txt ./ + +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + +CMD ["python", "run.py"] \ No newline at end of file diff --git a/README.md b/README.md index 84730e1..a6bd52a 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,21 @@ http://web.craftbeerpi.com/hardware/ CraftBeerPi 3.0 is a complete rewrite. Server as well as user interface. I recommend to use a second SD card for testing. +## Docker-based development + +For developing this application or its plugins on a PC/Mac you can use the docker-compose file: + +``` shell +$ docker-compose up +... +Starting craftbeerpi3_app_1 ... done +Attaching to craftbeerpi3_app_1 +app_1 | [2018-08-13 12:54:44,264] ERROR in __init__: BUZZER not working +app_1 | (1) wsgi starting up on http://0.0.0.0:5000 +``` + +The contents of this folder will be mounted to `/usr/src/craftbeerpi3` and the server will be accesible on `localhost:3000`. + ## Donation CraftBeerPi is a free & open source project. If you like to support the project I happy about a donation: diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..578f288 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +# docker-compose file for development on a pc/mac +version: '3.3' +services: + app: + build: . + ports: + - 5000:5000 + volumes: + - $PWD:/usr/src/app