feat(app): Initialize flask app
This commit is contained in:
1 parent
20d3a8e2bc
commit
837fb6e878
5 files changed
+50
No files matched your search
@@ -0,0 +1,6 @@
|
||||
.git/
|
||||
.github/
|
||||
.idea/
|
||||
.venv/
|
||||
shell.nix
|
||||
README.md
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN pip install --no-cache-dir -r dependencies.txt
|
||||
|
||||
ENV FLASK_ENV=production
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
CMD ["gunicorn", "app:app", "-b", "0.0.0.0:80", "--workers", "1"]
|
||||
@@ -0,0 +1,4 @@
|
||||
from flask import Flask, render_template
|
||||
import os
|
||||
|
||||
app = Flask(__name__)
|
||||
@@ -0,0 +1,3 @@
|
||||
flask==3.1.2
|
||||
loguru
|
||||
gunicorn
|
||||
@@ -0,0 +1,25 @@
|
||||
{ pkgs ? import <nixpkgs> {} }:
|
||||
|
||||
pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
python3
|
||||
ruff
|
||||
pyright
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
if [ ! -d ".venv" ]; then
|
||||
python -m venv .venv
|
||||
fi
|
||||
|
||||
source .venv/bin/activate
|
||||
|
||||
if [ -f "requirements-dev.txt" ]; then
|
||||
pip install -r requirements-dev.txt
|
||||
fi
|
||||
|
||||
if [ -f "dependencies.txt" ]; then
|
||||
pip install -r dependencies.txt
|
||||
fi
|
||||
'';
|
||||
}
|
||||
Reference in new issue
Block a user