From 0692898201024e6124374c2fa236d71da1f3a2ab Mon Sep 17 00:00:00 2001 From: cleverson Date: Thu, 7 Mar 2024 16:10:31 -0300 Subject: [PATCH 1/5] update license --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 21942bb..b08f931 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 Cleverson +Copyright (c) 2024 Cleverson.online Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 5e9a1f840e51742d701a7d1cece1c5180a17ad33 Mon Sep 17 00:00:00 2001 From: cleverson Date: Fri, 22 Mar 2024 09:43:14 -0300 Subject: [PATCH 2/5] remove register.html and login.html --- templates/login.html | 13 ------------- templates/register.html | 13 ------------- 2 files changed, 26 deletions(-) delete mode 100644 templates/login.html delete mode 100644 templates/register.html diff --git a/templates/login.html b/templates/login.html deleted file mode 100644 index 5f416a5..0000000 --- a/templates/login.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "layout.html" %} - -{% block y %} - -

Login

- -
- - - -
- -{% endblock %} \ No newline at end of file diff --git a/templates/register.html b/templates/register.html deleted file mode 100644 index 8800bff..0000000 --- a/templates/register.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "layout.html" %} - -{% block y %} - -

REGISTER

- -
- - - -
- -{% endblock %} \ No newline at end of file From 35fb48d214b37dd1e74005164a269d28e8ca1728 Mon Sep 17 00:00:00 2001 From: cleverson Date: Wed, 27 Mar 2024 15:47:23 -0300 Subject: [PATCH 3/5] =?UTF-8?q?removido=20os=20script=20de=20configura?= =?UTF-8?q?=C3=A7=C3=A3o=20do=20ci?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4d01da..0e2ce4d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: - name: 🔍 Checkout do repositorio uses: actions/checkout@v3 - - name: 🚀 Deploy to vps + - name: 🚀 Deploy uses: easingthemes/ssh-deploy@main env: SSH_PRIVATE_KEY: ${{ secrets.SSHKEY }} @@ -21,14 +21,4 @@ jobs: REMOTE_USER: ${{ secrets.USERNAME }} TARGET: ${{ secrets.TARGET }} EXCLUDE: ".env, /test/, .gitignore" - SCRIPT_AFTER: | - # Criar o ambiente virtual - python3.11 -m venv /var/www/blog/.venv - # Ativar o ambiente virtual - source /var/www/blog/.venv/bin/activate - # Atualizar o pip e instalar as dependências - python3.11 -m pip install --upgrade pip - pip install -r /var/www/blog/requirements.txt - # Desativar o ambiente virtual - deactivate - sudo service apache2 restart + From a24d819f53c571000d155d075f65c86fefc9c39e Mon Sep 17 00:00:00 2001 From: cleverson Date: Wed, 27 Mar 2024 15:48:40 -0300 Subject: [PATCH 4/5] foi adicionado as bibliotecas cachelib & gunicorn ao requirement.txt --- requirements.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/requirements.txt b/requirements.txt index 90d4221..dccb116 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,5 @@ Flask-Session >= 0.5.0 bcrypt >= 4.1.2 unidecode >= 1.3.8 pytz>=2024.1 +cachelib>=0.12.0 +gunicorn>=21.2.0 From 751396f64354de3aa93256ea979e998f021dca0e Mon Sep 17 00:00:00 2001 From: cleverson Date: Wed, 27 Mar 2024 15:50:43 -0300 Subject: [PATCH 5/5] =?UTF-8?q?adi=C3=A7=C3=A3o=20de=20conteiners?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 11 +++++++++++ docker-compose.yml | 28 ++++++++++++++++++++++++++++ nginx.conf | 19 +++++++++++++++++++ wsgi.py | 6 ++++++ 4 files changed, 64 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 nginx.conf create mode 100644 wsgi.py diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..870f97c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM python:3.11 + +WORKDIR /var/www/cleverson.online + +COPY requirements.txt . + +RUN pip install -r requirements.txt + +COPY . . + +CMD ['gunicorn','-b', '0.0.0.0:5000', 'wsgi:app'] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..c1185a0 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,28 @@ +version: "3.5" + +services: + nginx: + image: nginx:latest + volumes: + - ./nginx.conf:/etc/nginx/nginx.conf:ro + environment: + - FLASK_SERVER_ADDR=app:5000 + depends_on: + - app + ports: + - "80:80" + + app: + build: + context: . + ports: + - '5000:5000' + volumes: + - ${HOME}/.database:/root/.database + command: gunicorn -w 2 -b 0.0.0.0:5000 wsgi:app + + +networks: + default: + driver: bridge + name: cleverson.online diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..2525be1 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,19 @@ +events {} + +http { + access_log on; + sendfile on; + + server { + listen 80; + server_name localhost; + + location / { + proxy_pass http://app:5000; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + } +} diff --git a/wsgi.py b/wsgi.py new file mode 100644 index 0000000..fe05d46 --- /dev/null +++ b/wsgi.py @@ -0,0 +1,6 @@ +from app import create_app + +app = create_app() + +if __name__ == "__main__": + app.run()