From a92a7031ab253ca3444c34820aaea2d77e27da87 Mon Sep 17 00:00:00 2001 From: Chris Mitchell Date: Sun, 8 Apr 2018 15:25:27 -0400 Subject: [PATCH] Fix configuration of wooey and celery to properly inherit from new docker config --- .dockerignore | 60 ++++++++++++++++++++++++++ docker/.env | 1 + docker/Dockerfile | 2 +- docker/docker-compose.common.yml | 21 +++++++++ docker/docker-compose.yml | 26 +++-------- docker_wooey/settings/user_settings.py | 0 6 files changed, 90 insertions(+), 20 deletions(-) create mode 100644 .dockerignore create mode 100644 docker/.env create mode 100644 docker/docker-compose.common.yml create mode 100755 docker_wooey/settings/user_settings.py diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..1cd6909 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,60 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover + +# Translations +#*.mo Include so users don't have to self-build +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# IDE +.idea diff --git a/docker/.env b/docker/.env new file mode 100644 index 0000000..c8cd72b --- /dev/null +++ b/docker/.env @@ -0,0 +1 @@ +BUILD_DIR=/wooey_build \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile index 56f6cbc..b25fd53 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ FROM python:2.7 -ENV BUILD_DIR=/wooey_build +ARG BUILD_DIR RUN pip install psycopg2 diff --git a/docker/docker-compose.common.yml b/docker/docker-compose.common.yml new file mode 100644 index 0000000..8c032e0 --- /dev/null +++ b/docker/docker-compose.common.yml @@ -0,0 +1,21 @@ +version: '2.1' +volumes: + user_uploads: + wooey_db: + +services: + common: + build: + context: .. + dockerfile: docker/Dockerfile + image: wooey:dev + volumes : + - ./user_settings.py:/docker_wooey/docker_wooey/settings/user_settings.py + - user_uploads:/docker_wooey/docker_wooey/user_uploads + environment: + AMQP_URL: amqp://rabbit:5672 + DATABASE_NAME: wooey + DATABASE_USER: wooey + DATABASE_URL: db + DATABASE_PASSWORD: wooey + user: 1000:1000 diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 63459f6..7e455c0 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -4,24 +4,10 @@ volumes: wooey_db: services: - common: - build: - context: .. - dockerfile: docker/Dockerfile - image: wooey:dev - volumes : - - ./user_settings.py:/docker_wooey/docker_wooey/settings/user_settings.py - - user_uploads:/docker_wooey/docker_wooey/user_uploads - environment: - AMQP_URL: amqp://rabbit:5672 - DATABASE_NAME: wooey - DATABASE_USER: wooey - DATABASE_URL: db - DATABASE_PASSWORD: wooey - user: 1000:1000 - wooey: - extends: common + extends: + file: docker-compose.common.yml + service: common ports: - 8081:8080 depends_on: @@ -30,8 +16,10 @@ services: command: ./run-server celery: - extends: common - command: celery worker -A docker_wooey -c 4 --beat -l info -s schedule + extends: + file: docker-compose.common.yml + service: common + command: celery worker -A docker_wooey -c 4 -B -l debug -s schedule rabbit: image: rabbitmq diff --git a/docker_wooey/settings/user_settings.py b/docker_wooey/settings/user_settings.py new file mode 100755 index 0000000..e69de29