fix: configura Flask para produção com gunicorn e ajusta Dockerfile para Coolify

This commit is contained in:
LS
2025-04-04 18:07:04 -03:00
parent daaa7fd462
commit 786040162b
3 changed files with 9 additions and 2 deletions

View File

@@ -32,6 +32,8 @@ EXPOSE 5000
# Definir o ambiente virtual como padrão
ENV PATH="/venv/bin:$PATH"
ENV FLASK_APP=app.py
ENV FLASK_ENV=production
# Comando para rodar a aplicação
CMD ["make", "run"]
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "app:app"]

6
app.py
View File

@@ -1702,4 +1702,8 @@ def init_system():
if __name__ == '__main__':
init_system()
app.run(debug=True)
app.run(
host='0.0.0.0',
port=5000,
debug=os.getenv('FLASK_ENV') == 'development'
)

View File

@@ -15,3 +15,4 @@ bcrypt==4.1.2
Bootstrap-Flask==2.3.3
flask-bootstrap5==0.1.dev1
PyJWT==2.8.0
gunicorn==21.2.0