neues dockerfile mit gunicorn Server
This commit is contained in:
8
.dockerignore
Normal file
8
.dockerignore
Normal file
@@ -0,0 +1,8 @@
|
||||
.git
|
||||
.gitignore
|
||||
media/
|
||||
__pycache__/
|
||||
*.pyc
|
||||
.DS_Store
|
||||
README.md
|
||||
AGENTS.md
|
||||
12
Dockerfile
12
Dockerfile
@@ -1,12 +1,16 @@
|
||||
FROM python:3.12-slim
|
||||
FROM python:3.13-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt ./
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt gunicorn
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN addgroup --system app && adduser --system --ingroup app app && \
|
||||
chown -R app:app /app
|
||||
USER app
|
||||
|
||||
EXPOSE 5005
|
||||
|
||||
CMD ["python", "app.py"]
|
||||
CMD ["gunicorn", "-b", "0.0.0.0:5005", "-w", "4", "app:app"]
|
||||
|
||||
@@ -124,6 +124,8 @@ Server läuft auf `http://localhost:5005`.
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
Server läuft auf `http://localhost:5005` (gunicorn mit 4 Workern, non-root User).
|
||||
|
||||
---
|
||||
|
||||
## Routen
|
||||
|
||||
3
app.py
3
app.py
@@ -1584,6 +1584,7 @@ def admin_users_reset_password(email):
|
||||
# -------------------------------------------------
|
||||
# Main
|
||||
# -------------------------------------------------
|
||||
if __name__ == "__main__":
|
||||
init_user_db()
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(debug=True, host="0.0.0.0", port=5005)
|
||||
|
||||
Reference in New Issue
Block a user