Base Programm files
This commit is contained in:
1 parent
20d3c8a7b4
commit
41326bf7d9
6 files changed
+74
No files matched your search
+20
@@ -0,0 +1,20 @@
|
|||||||
|
# Nutze ein leichtes, stabiles Python-Image
|
||||||
|
FROM python:3.12-slim
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Abhängigkeiten installieren
|
||||||
|
COPY requirements.txt .
|
||||||
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
# Deinen Code kopieren
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# WICHTIG: Ordner für die SQLite-Datenbank (damit die Daten bei Neustarts nicht gelöscht werden)
|
||||||
|
RUN mkdir -p /app/data
|
||||||
|
|
||||||
|
# Port freigeben
|
||||||
|
EXPOSE 8000
|
||||||
|
|
||||||
|
# Server starten (0.0.0.0 ist wichtig, damit er von außerhalb des Containers erreichbar ist)
|
||||||
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||||
Whitespace-only changes.
@@ -0,0 +1,9 @@
|
|||||||
|
from fastapi import FastAPI, Request
|
||||||
|
from fastapi.templating import Jinja2Templates
|
||||||
|
|
||||||
|
app = FastAPI()
|
||||||
|
templates = Jinja2Templates(directory="templates")
|
||||||
|
|
||||||
|
@app.get("/")
|
||||||
|
async def home(request: Request):
|
||||||
|
return templates.TemplateResponse(request=request, name="index.html")
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
annotated-doc==0.0.5
|
||||||
|
annotated-types==0.8.0
|
||||||
|
anyio==4.14.2
|
||||||
|
certifi==2026.7.22
|
||||||
|
click==8.4.2
|
||||||
|
fastapi==0.141.1
|
||||||
|
greenlet==3.5.5
|
||||||
|
h11==0.16.0
|
||||||
|
httpcore==1.0.9
|
||||||
|
httpx==0.28.1
|
||||||
|
idna==3.19
|
||||||
|
Jinja2==3.1.6
|
||||||
|
MarkupSafe==3.0.3
|
||||||
|
pydantic==2.13.4
|
||||||
|
pydantic_core==2.46.4
|
||||||
|
SQLAlchemy==2.0.52
|
||||||
|
sqlmodel==0.0.39
|
||||||
|
starlette==1.6.0
|
||||||
|
typing-inspection==0.4.4
|
||||||
|
typing_extensions==4.16.0
|
||||||
|
uvicorn==0.52.4
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="de">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Shoppingliste</title>
|
||||||
|
<!-- Tailwind via CDN -->
|
||||||
|
<script src="https://cdn.tailwindcss.com"></script>
|
||||||
|
<!-- Alpine.js via CDN -->
|
||||||
|
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="bg-gray-100 p-8">
|
||||||
|
<div class="max-w-2xl mx-auto bg-white p-6 rounded-lg shadow-md">
|
||||||
|
{% block content %}{% endblock %}
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div x-data="{ title: 'Meine Shoppingliste' }">
|
||||||
|
<h1 class="text-2xl font-bold mb-4" x-text="title"></h1>
|
||||||
|
<p>Das Grundgerüst steht!</p>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
Reference in new issue
Block a user