Zum Hauptinhalt springen
ProdukteDesktop-WerkzeugeTASTECADZeichnungsprüfungTASTEFILESDateiverwaltungTASTEFTPDateiübertragungTASTESSHRemote-ArbeitsbereichTASTEZIPKomprimieren und EntpackenEntwicklerwerkzeugeTASTECODEIntegrierte Entwicklungsumgebung für RustTASTESTUDIOIntegrierte Entwicklungs- und TestumgebungTASTEETLDatenintegration (ETL)ServerTASTEREMOTERemote-Desktop-ServerTASTEGEOGeodatenserverTASTEMAILE-Mail-ArbeitsbereichErste SchritteDownloadsDokumentationKaufenAlle Produkte
Marktplatz
Neuigkeiten
TechnikNeuigkeitenEntwickler-News von heuteEntwicklerdokuProgrammiersprachenRustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartWeb-Frontend-FrameworksNext.jsReactVue.js · NuxtSvelteKitAngularServer-FrameworksSpring BootDjangoFastAPIASP.NET CoreNestJS · ExpressApp- & Desktop-FrameworksTauriFlutterReact NativeElectronAlgorithmenAlgorithmus-GrundlagenKernalgorithmenFortgeschrittene AlgorithmenAlgorithmen für die Praxis
CommunityProjekteEntwicklungslogsPromptsProbleme mit KI-ToolsShowcaseCommunity-Leitfaden
ZusammenarbeitWissenstransferWebsite-AufbauDesktop-App-AufbauRelease- und ZahlungspipelineVertriebspartnerKontakt
DiensteRemote-DesktopIndividuelle Installationspakete
TASTEDEV
Produkte

Desktop-Werkzeuge

TASTECADKomplexe Zeichnungen, mühelos geöffnetTASTEFILESNur die Dateien, die zählen – in BestzeitTASTEFTPDer aufgeräumteste Weg für Ihre DateienTASTESSHDie stärkere Verbindung zu Ihren ServernTASTEZIPSchneller packen, sicherer entpacken

Entwicklerwerkzeuge

TASTECODERust-Apps bearbeiten, bauen, debuggen und testen – alles in einem FensterTASTESTUDIOVom Bearbeiten bis zu Remote-Tests und freigegebenen KI-KorrekturenTASTEETLDaten bewegen, die Werte im Blick

Server

TASTEREMOTEEin Remote-Desktop auf Ihrem eigenen ServerTASTEGEOEin GeoServer-kompatibler Geodatenserver, neu aufgebaut in RustTASTEMAILIhre E-Mail wieder in Ihrer Hand

Erste Schritte

DownloadsNeueste Versionen aller ProdukteDokuSo nutzen Sie jedes ProduktKaufenAbos und DauerlizenzenAlle ProdukteAlle Produkte im Überblick
Alle Produkte
MarktplatzNeuigkeiten
Technik

Neuigkeiten

Entwickler-News von heuteOffizielle Meldungen zu Sprachen, Frameworks, GitHub und KIEntwicklerdokuAnleitungen zu Sprachen, Frameworks und Algorithmen

Programmiersprachen

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

Frameworks

Web-Frontend-FrameworksNext.jsReactVue.js · NuxtSvelteKitAngular
Server-FrameworksSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
App- & Desktop-FrameworksTauriFlutterReact NativeElectron

Algorithmen

Algorithmus-GrundlagenKomplexitätsanalyse · Sortieren · Suchen · Grundlegende Datenstrukturen · Bäume und HeapsKernalgorithmenGraphtraversierung · Kürzeste Wege und minimale Spannbäume · Dynamische Programmierung · Greedy-Algorithmen · Teile und herrsche · BacktrackingFortgeschrittene AlgorithmenZeichenkettenalgorithmen · Mathematik und Zahlentheorie · Bitmanipulation · Segmentbäume · Union-FindAlgorithmen für die PraxisStrategie für Coding-Interviews · LRU-Cache · Rate Limiting · Konsistentes Hashing
Alle Entwicklungsdokumente
Community
ProjekteEntwickler und Projekte entdeckenEntwicklungslogsEntscheidungen und ErkenntnissePromptsWiederverwendbare AnweisungenProbleme mit KI-ToolsProbleme und Workarounds für Claude, Codex, GeminiShowcaseFertige ErgebnisseCommunity-LeitfadenWie wir offen entwickeln
Zusammenarbeit
WissenstransferNative Apps mit Rust und eguiWebsite-Aufbau10 Sprachen, Konten, Dokumentation und DownloadsDesktop-App-AufbauRust und egui, ohne WebViewRelease- und ZahlungspipelineSignatur, MSI, deb, rpm, AppImage, PrüfsummenVertriebspartnerEmpfehlen und 30 % erhaltenKontaktEntwicklung, Partnerschaft, Investition
Dienste
Remote-DesktopIhren Computer im Browser erreichenIndividuelle InstallationspaketeNur nötige Funktionen, Einstellungen vorab
Kaufen
DE
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
Anmelden
Anmelden
TASTEDEV

Von kleinen Werkzeugen zu besserer Entwicklung.

support@tastedev.netTASTEDEV unterstützen
ProdukteProduktübersichtKaufenDokuDownloadsMarktplatzSupport
CommunityProjekteEntwicklungslogsPromptsProbleme mit KI-ToolsShowcase
RichtlinienDatenschutzerklärungNutzungsbedingungenAbo-BedingungenRückerstattungCommunity-Richtlinien
KontoAnmeldenRegistrieren
Besucher
Heute
012345678901234567890123456789012345678901234567890123456789
Gestern
012345678901234567890123456789012345678901234567890123456789
Aufrufe gesamt
0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
Firma
GXSOFT
Vertretungsberechtigt
CHOI YOUNG GU
Handelsregisternummer
853-44-00368
Anschrift
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
Telefon
+82-10-4404-1523
E-Mail
whitecalvin@tastedev.net
Datenschutzbeauftragter
CHOI YOUNG GU

© 2026 TASTEDEVProduktinformationen basieren auf verifizierten Entwicklungsquellen.Veröffentlicht · wird verbessert

FastAPI-Dokumentation
FastAPI
Getting Started with FastAPIProject StructureCore ConceptsData and StateTestingDeployment
Diskussionen

FastAPI-Anleitung · 6/6

Deployment

Dieses Kapitel ist vorerst nur auf Englisch verfügbar.

A FastAPI application has no build step: you deploy it by running it on an ASGI server. This chapter covers running a production server with fastapi run and Uvicorn, choosing the number of worker processes, building a container image, and what to watch for behind a reverse proxy.

Running in production with fastapi run

fastapi dev is for development; in production, use fastapi run. It turns off auto-reload and by default listens on port 8000 on all network interfaces (0.0.0.0).

# a single process
fastapi run app/main.py

# another port, with four worker processes
fastapi run app/main.py --port 80 --workers 4

fastapi run uses Uvicorn under the hood. Running Uvicorn yourself gives the same result; in that case you point it at the app as module:variable instead of a file path.

uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4

Workers and process management

A single Python process effectively uses one CPU core, so to use several cores you start several processes with --workers. Start around the number of cores and tune with load testing. Each worker has its own memory, so keep an eye on memory use if your app loads large models.

If you deploy straight onto a server, use a process manager such as systemd so the app restarts after a reboot or a crash. On platforms like Kubernetes, where the cluster manages how many containers run, the usual approach is a single process per container and scaling by adding replicas.

Building a container image

Containers let you reproduce the runtime environment exactly. The approach recommended in the official docs starts from the official Python image, installs dependencies first and copies the code afterwards, so that changing only the code reuses the cached dependency layer.

FROM python:3-slim

WORKDIR /code

COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt

COPY ./app /code/app

CMD ["fastapi", "run", "app/main.py", "--port", "80"]

In a real project, pin the image tag to the same Python version you develop with. Write CMD in the exec (array) form shown above so that stop signals reach the app and your lifespan cleanup code actually runs.

docker build -t hello-fastapi .
docker run -d --name hello -p 8000:80 --env-file .env hello-fastapi

Keep .env out of the image and supply it at run time with --env-file or your platform's secrets feature. Listing .venv, .env and __pycache__ in .dockerignore keeps the image small.

Fragen zu diesem Kapitel?
Vorheriges KapitelTesting

Behind a reverse proxy

In production, a reverse proxy such as Nginx, Traefik or a cloud load balancer usually terminates HTTPS and forwards requests to the app. So the app can see the original client address and the https scheme, the proxy adds X-Forwarded-* headers, and the app server accepts those headers only from proxies it trusts.

server {
    listen 443 ssl;
    server_name api.example.com;

    location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
uvicorn app.main:app --host 127.0.0.1 --port 8000 --proxy-headers --forwarded-allow-ips="127.0.0.1"

If the proxy serves the app under a path prefix such as /api, tell FastAPI with FastAPI(root_path="/api") or the --root-path /api option so that /docs and generated links use the right URLs.

Pre-deployment checklist

  • Never use fastapi dev or --reload in production.
  • Pass secrets as environment variables; keep them out of the repository and the image.
  • Apply database schema changes with a migration tool such as Alembic.
  • For non-public APIs, you can turn off the docs UI with FastAPI(docs_url=None, redoc_url=None).
  • Expose a health check endpoint such as /health for load balancers and orchestrators.

Summary

  • Run production servers with fastapi run or uvicorn, and set the process count with --workers.
  • Build container images that install dependencies before copying code, to make the most of the cache.
  • Behind a reverse proxy, configure proxy headers and root_path correctly.

For more detail, see the official documentation:

  • FastAPI Deployment
  • FastAPI in Containers - Docker
  • Behind a Proxy
  • Uvicorn Deployment
  • FastAPI documentation

0 Kommentare

Top-KommentareNeueste zuerst

Anmelden · Melde dich an, um einen Kommentar zu schreiben.