COPY requirements.txt requirements.txt
RUN pip install -r ./requirements.txt
RUN pip install gunicorn
-RUN pip install psycopg2
-COPY runprodguni.sh ./
-COPY rundebug.sh ./
-RUN chmod +x runprodguni.sh
-
-COPY setup.py ./setup.py
+COPY utils utils
COPY app app
COPY migrations migrations
COPY config.cfg ./config.cfg
use_ssl=True,
base_url=None)
-if not app.debug:
+if not app.debug and app.config["MAIL_UTILS_ERROR_SEND_TO"]:
from .maillogger import register_mail_error_handler
register_mail_error_handler(app, mail)
app:
build: .
- command: ./rundebug.sh
+ command: ./utils/run.sh
+ env_file:
+ - config.env
ports:
- 5123:5123
volumes:
worker:
build: .
- command: celery -A app.tasks.celery worker
+ command: FLASK_CONFIG=../config.cfg celery -A app.tasks.celery worker
env_file:
- config.env
volumes:
pillow~=5.3
pyScss~=1.3
redis==2.10.6
+psycopg2~=2.7
--- /dev/null
+#!/bin/bash
+
+# Debug
+# FLASK_APP=app/__init__.py FLASK_CONFIG=../config.cfg FLASK_DEBUG=1 python3 -m flask run -h 0.0.0.0 -p 5123
+
+if [ -z "$FLASK_DEBUG" ]; then
+ echo "FLASK_DEBUG is required in config.env"
+ exit 1
+fi
+
+gunicorn -w 4 -b :5123 -e FLASK_APP=app/__init__.py -e FLASK_CONFIG=../config.cfg -e FLASK_DEBUG=$FLASK_DEBUG app:app
+++ /dev/null
-#!/bin/bash
-
-FLASK_APP=app/__init__.py FLASK_CONFIG=../config.cfg FLASK_DEBUG=1 python3 -m flask run -h 0.0.0.0 -p 5123
+++ /dev/null
-#!/bin/bash
-
-FLASK_APP=app/__init__.py FLASK_CONFIG=../config.cfg FLASK_DEBUG=0 python3 -m flask run -h 0.0.0.0 -p 5123
+++ /dev/null
-#!/bin/bash
-
-gunicorn -w 4 -b :5123 -e FLASK_APP=app/__init__.py -e FLASK_CONFIG=../config.cfg -e FLASK_DEBUG=0 app:app