Skip to content

Commit

Permalink
Merge pull request #1 from thisiscleverson/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
thisiscleverson authored Mar 27, 2024
2 parents 1e2170e + 751396f commit 6038fb4
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 39 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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

11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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']
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
28 changes: 28 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -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;
}
}
}
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 0 additions & 13 deletions templates/login.html

This file was deleted.

13 changes: 0 additions & 13 deletions templates/register.html

This file was deleted.

6 changes: 6 additions & 0 deletions wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from app import create_app

app = create_app()

if __name__ == "__main__":
app.run()

0 comments on commit 6038fb4

Please sign in to comment.