From 90b26400ec5335d8a58d26349d29ca147a49e735 Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Sat, 26 Nov 2022 14:48:11 +0100 Subject: [PATCH] Merge N2 Signed-off-by: Bensuperpc --- Makefile | 2 +- docker-compose.yml | 37 +++++++++++++++++++--- flask/Dockerfile | 12 ------- flask/__pycache__/website.cpython-311.pyc | Bin 601 -> 0 bytes flask/app.ini | 20 ------------ flask/requirements.txt | 12 ------- flask/website.py | 9 ------ flask/wsgi.py | 4 --- 8 files changed, 34 insertions(+), 62 deletions(-) delete mode 100644 flask/Dockerfile delete mode 100644 flask/__pycache__/website.cpython-311.pyc delete mode 100644 flask/app.ini delete mode 100644 flask/requirements.txt delete mode 100644 flask/website.py delete mode 100644 flask/wsgi.py diff --git a/Makefile b/Makefile index 1ba6280..a9fd51e 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ DOCKER := docker -PROFILE := db wordpress webserver certbot phpmyadmin flask_website qbittorrent +PROFILE := wp_db wordpress webserver certbot phpmyadmin flask_website flask_db qbittorrent PROFILE_CMD := $(addprefix --profile ,$(PROFILE)) COMPOSE_FILE := docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml index 0c3d221..6635d95 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,8 +22,7 @@ services: image: mariadb:10.10.2 container_name: wp_db profiles: - - db - - wordpress + - wp_db restart: unless-stopped env_file: - env/wp_database.env @@ -51,14 +50,41 @@ services: flask_website: build: - context: ./flask + context: ./bensuperpc_website dockerfile: Dockerfile container_name: flask_website profiles: - flask_website + depends_on: + - flask_db volumes: - - ./flask:/app:rw + - ./bensuperpc_website:/app:rw + environment: + FLASK_DEBUG: "${FLASK_DEBUG:-1}" + POSTGRES_URL: "${POSTGRES_URL:-flask_db:5432}" + POSTGRES_USER: "${POSTGRES_USER:-postgres}" + POSTGRES_PW: "${POSTGRES_PW:-postgres}" + POSTGRES_DB: "${POSTGRES_DB:-website}" restart: unless-stopped + ports: + - 5000:5000 + networks: + - app-network + flask_db: + image: postgres:latest + container_name: flask_db + profiles: + - flask_db + restart: unless-stopped + environment: + POSTGRES_HOST_AUTH_METHOD: "${POSTGRES_HOST_AUTH_METHOD:-trust}" + POSTGRES_USER: "${POSTGRES_USER:-postgres}" + POSTGRES_PASSWORD: "${POSTGRES_PW:-postgres}" + POSTGRES_DB: "${POSTGRES_DB:-website}" +# ports: +# - 5432:5432 + volumes: + - postgres-data:/var/lib/postgresql/data networks: - app-network qbittorrent: @@ -117,6 +143,9 @@ volumes: downloads: name: downloads + postgres-data: + name: postgres-data + networks: app-network: driver: bridge diff --git a/flask/Dockerfile b/flask/Dockerfile deleted file mode 100644 index 1c7f06e..0000000 --- a/flask/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -ARG DOCKER_IMAGE=python:3.11-buster -FROM $DOCKER_IMAGE - -WORKDIR /app - -COPY requirements.txt requirements.txt - -RUN pip install --no-cache-dir -r requirements.txt - -EXPOSE 5000 - -CMD ["uwsgi", "app.ini"] diff --git a/flask/__pycache__/website.cpython-311.pyc b/flask/__pycache__/website.cpython-311.pyc deleted file mode 100644 index 88717cebbd914abd815912958b5e04e22e491700..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 601 zcmZ8du}%U(5S_if<3J>8r36B-5othTurNp|R5V!8T!341go7h{5Ce@sNT9T{rNS8e z0>1){1-XjE$__(E-Wr1JNBUZ<;PHi}<^y1j= zi9nUJwuYTw92rKIbgk#j@)AXh8&84L%)uMN#V3z76Qfpe0#_`m}lKcluCo^rB zx#JUeoXRY)oQhJ(m#T`=lFuUcVpK)VFzcDHY)QAAGvx$1vYM|DMX@mJVoB6!)QMf% z!n9GfY1lO>@3M3zDu&w7Ns=D0kdJA$n3-dQ&=d|Q+k5J8x5*&gF?vQD&yd*ncD;l1 zPM{Z<3kY4zftha%!v5;Q0pjkU^^Uzf<)4ajKh;e=c-yHr(f1+xCacZ+`E88N?FaPt Bf0h6M diff --git a/flask/app.ini b/flask/app.ini deleted file mode 100644 index 7f69240..0000000 --- a/flask/app.ini +++ /dev/null @@ -1,20 +0,0 @@ -[uwsgi] -plugins = python - -wsgi-file = wsgi.py -callable = app -# Or: module = wsgi:app - -socket = :8080 -# Or: socket = flask_server.sock -chmod-socket = 660 - -processes = 8 -threads = 2 -master = true - -vacuum = true -die-on-term = true -# enable-threads = true #enable threads support - -env = LANG=en_US.UTF-8 diff --git a/flask/requirements.txt b/flask/requirements.txt deleted file mode 100644 index 5bc97eb..0000000 --- a/flask/requirements.txt +++ /dev/null @@ -1,12 +0,0 @@ -requests - -flask -flask-babel -flask-login -flask-sqlalchemy -flask-assets -flask-wtf -flask-mail - - -uwsgi diff --git a/flask/website.py b/flask/website.py deleted file mode 100644 index 34b1c5c..0000000 --- a/flask/website.py +++ /dev/null @@ -1,9 +0,0 @@ -from flask import Flask -app = Flask(__name__) - -@app.route("/") -def hello(): - return "

Hello There!

" - -if __name__ == "__main__": - app.run(host='0.0.0.0') diff --git a/flask/wsgi.py b/flask/wsgi.py deleted file mode 100644 index 375e654..0000000 --- a/flask/wsgi.py +++ /dev/null @@ -1,4 +0,0 @@ -from website import app - -if __name__ == "__main__": - app.run(host="0.0.0.0")