Vai al contenuto principale
ProdottiStrumenti desktopTASTECADVisualizzazione disegniTASTEFILESGestione fileTASTEFTPTrasferimento fileTASTESSHSpazio di lavoro remotoTASTEZIPCompressione ed estrazioneStrumenti per sviluppatoriTASTECODEAmbiente di sviluppo integrato per RustTASTESTUDIOAmbiente integrato di sviluppo e testTASTEETLIntegrazione dati (ETL)ServerTASTEREMOTEServer di desktop remotoTASTEGEOServer geospazialeTASTEMAILSpazio di lavoro emailIniziaDownloadDocumentazioneAcquistaTutti i prodotti
Marketplace
Notizie
TecnologiaNotizieNotizie di sviluppo di oggiDocumentazioneLinguaggi di programmazioneRustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartFramework frontend webNext.jsReactVue.js · NuxtSvelteKitAngularFramework serverSpring BootDjangoFastAPIASP.NET CoreNestJS · ExpressFramework per app e desktopTauriFlutterReact NativeElectronAlgoritmiBasi degli algoritmiAlgoritmi fondamentaliAlgoritmi avanzatiAlgoritmi pratici
CommunityProgettiLog di sviluppoPromptProblemi degli strumenti di IAVetrinaGuida alla community
CollaboraTrasferimento tecnicoRealizzazione del sito webRealizzazione di app desktopPipeline di rilascio e pagamentoPartner commercialeContatti
ServiziDesktop remotoPacchetti di installazione su misura
TASTEDEV
Prodotti

Strumenti desktop

TASTECADApri con leggerezza anche i disegni più complessiTASTEFILESSolo i file che servono, alla massima velocitàTASTEFTPLa via più ordinata per i tuoi fileTASTESSHUn legame più solido tra te e i tuoi serverTASTEZIPComprimi più veloce, estrai più sicuro

Strumenti per sviluppatori

TASTECODEModifica, compila, esegui il debug e testa app Rust in un'unica finestraTASTESTUDIODalla modifica ai test remoti e alle correzioni IA approvateTASTEETLSposta i dati guardando i valori

Server

TASTEREMOTEUn desktop remoto che gira sul tuo serverTASTEGEOUn server geospaziale compatibile con GeoServer, ricostruito in RustTASTEMAILRiprendi il controllo della tua posta

Inizia

DownloadUltime versioni di ogni prodottoDocsCome usare ogni prodottoAcquistaAbbonamenti e licenze perpetueTutti i prodottiTutti i prodotti a colpo d’occhio
Tutti i prodotti
MarketplaceNotizie
Tecnologia

Notizie

Notizie di sviluppo di oggiAnnunci ufficiali su linguaggi, framework, GitHub e IADocumentazioneGuide a linguaggi, framework e algoritmi

Linguaggi di programmazione

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

Framework

Framework frontend webNext.jsReactVue.js · NuxtSvelteKitAngular
Framework serverSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
Framework per app e desktopTauriFlutterReact NativeElectron

Algoritmi

Basi degli algoritmiAnalisi della complessità · Ordinamento · Ricerca · Strutture dati di base · Alberi e heapAlgoritmi fondamentaliVisita dei grafi · Cammini minimi e alberi ricoprenti · Programmazione dinamica · Algoritmi greedy · Divide et impera · BacktrackingAlgoritmi avanzatiAlgoritmi sulle stringhe · Matematica e teoria dei numeri · Manipolazione dei bit · Alberi di segmenti · Union-FindAlgoritmi praticiStrategia per colloqui di programmazione · Cache LRU · Rate limiting · Hashing consistente
Tutta la documentazione di sviluppo
Community
ProgettiScopri sviluppatori e lavoriLog di sviluppoDecisioni e lezioni appresePromptIstruzioni riutilizzabiliProblemi degli strumenti di IAProblemi e alternative di Claude, Codex, GeminiVetrinaRisultati completatiGuida alla communityCome sviluppiamo in modo aperto
Collabora
Trasferimento tecnicoApp native in Rust ed eguiRealizzazione del sito web10 lingue, account, documentazione e downloadRealizzazione di app desktopRust ed egui, senza WebViewPipeline di rilascio e pagamentoFirma, MSI, deb, rpm, AppImage, hashPartner commercialeConsigliaci e ricevi il 30%ContattiSviluppo, partnership e investimenti
Servizi
Desktop remotoRaggiungi il tuo computer dal browserPacchetti di installazione su misuraSolo il necessario, impostazioni precaricate
Acquista
IT
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
Accedi
Accedi
TASTEDEV

Dai piccoli strumenti a uno sviluppo migliore.

support@tastedev.netSostieni TASTEDEV
ProdottiGamma di prodottiAcquistaDocsDownloadMarketplaceAssistenza
CommunityProgettiLog di sviluppoPromptProblemi degli strumenti di IAVetrina
NormeInformativa sulla privacyTermini di servizioCondizioni di abbonamentoRimborsiLinee guida della community
AccountAccediRegistrati
Visitatori
Oggi
012345678901234567890123456789012345678901234567890123456789
Ieri
012345678901234567890123456789012345678901234567890123456789
Visualizzazioni totali
0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
Società
GXSOFT
Rappresentante
CHOI YOUNG GU
Numero di registrazione
853-44-00368
Indirizzo
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
Telefono
+82-10-4404-1523
E-mail
whitecalvin@tastedev.net
Responsabile privacy
CHOI YOUNG GU

© 2026 TASTEDEVLe informazioni sui prodotti si basano su fonti di sviluppo verificate.Rilasciato · in miglioramento

Documentazione di FastAPI
FastAPI
Getting Started with FastAPIProject StructureCore ConceptsData and StateTestingDeployment
Discussioni

Guida a FastAPI · 6/6

Deployment

Per ora questo capitolo è disponibile solo in inglese.

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.

Domande su questo capitolo?
Capitolo precedenteTesting

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 commenti

Commenti principaliPrima i più recenti

Accedi · Accedi per lasciare un commento.