Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
YouTube Security VideosWelcome to GitHub Copilot Day: the future of agentic engineering(22.09.2026 um 20:00 Uhr)
YouTube Security VideosMicrosoft Mechanics: What Can a Copilot Agent Actually Read?(22.09.2026 um 20:27 Uhr)
Unix & Linux ServerPeppermintOS Is Moving From Xorg to XLibre to Avoid Wayland(22.09.2026 um 19:58 Uhr)
Sicherheitslücken (CVE)USN-8803-1: Sudo vulnerability(22.09.2026 um 16:15 Uhr)
Sichere ProgrammierungClaude Opus 5.5 is now available in GitHub Copilot(22.09.2026 um 19:10 Uhr)
Sichere ProgrammierungColab is now part of your Google AI plan(22.09.2026 um 20:51 Uhr)
Sichere ProgrammierungThe Hidden Production Risks of Third-Party SDKs(22.09.2026 um 20:00 Uhr)
YouTube Security VideosWelcome to GitHub Copilot Day: the future of agentic engineering(22.09.2026 um 20:00 Uhr)
YouTube Security VideosMicrosoft Mechanics: What Can a Copilot Agent Actually Read?(22.09.2026 um 20:27 Uhr)
Unix & Linux ServerPeppermintOS Is Moving From Xorg to XLibre to Avoid Wayland(22.09.2026 um 19:58 Uhr)
Sicherheitslücken (CVE)USN-8803-1: Sudo vulnerability(22.09.2026 um 16:15 Uhr)
Sichere ProgrammierungClaude Opus 5.5 is now available in GitHub Copilot(22.09.2026 um 19:10 Uhr)
Sichere ProgrammierungColab is now part of your Google AI plan(22.09.2026 um 20:51 Uhr)
Sichere ProgrammierungThe Hidden Production Risks of Third-Party SDKs(22.09.2026 um 20:00 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

How to deploy Fast API

FastAPI + Docker + AWS EC2 Deployment Guide Prerequisites (Local) 1. Create a Dockerfile Create a Dockerfile in your project root: FROM python:3.12-slim WORKDIR /app COPY requirements.txt . RUN pip install -r…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!




FastAPI + Docker + AWS EC2 Deployment Guide









Prerequisites (Local)






1. Create a Dockerfile



Create a Dockerfile in your project root:




FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]







If your project structure follows app/main.py, set the entry point as app.main:app










2. Push to GitHub






git add Dockerfile
git commit -m "Add Dockerfile"
git push origin main












AWS EC2 Setup




⚠️ We were using a provided AWS account, so the EC2 setup process is slightly different from the standard approach. Follow the steps below carefully.










3. Create a Security Group First




  • EC2 Console → Left menu Security GroupsCreate security group

  • Enter name and description

  • Select VPC → Click Create


  • Wait 5–10 seconds (for automatic tag attachment)









4. Add Inbound Rules



After confirming the tag is attached, edit inbound rules:




























Type Port Source
SSH 22 0.0.0.0/0
HTTP 80 0.0.0.0/0
Custom TCP 8000 0.0.0.0/0


Click Save rules









5. Launch an EC2 Instance




  • Enter a name (e.g., my_projectname)

  • OS: Ubuntu 22.04 LTS

  • Instance type: t3.micro

  • Key pair: Create new → Download and save the .pem file

  • Security group: Select the one you just created

  • Click Launch instance









6. Set an Instance Profile




  • Select instance → Actions → Security → Modify IAM role

  • Choose SafeInstanceProfile-{username} → Save









EC2 Server Configuration






7. Connect to EC2




  • Confirm instance status is running

  • Click ConnectEC2 Instance Connect tab → Click Connect

  • A black terminal window in your browser means success









8. Set Up the Server Environment






sudo apt update && sudo apt upgrade -y
sudo apt install python3-pip python3-venv git -y












9. Install Docker






sudo apt install docker.io -y
sudo systemctl start docker
sudo systemctl enable docker
sudo usermod -aG docker ubuntu







⚠️ After installation, close the terminal and reconnect via EC2 Instance Connect!




After reconnecting, verify Docker is installed:




docker --version












10. Clone the Repository




Use a Personal Access Token instead of your GitHub password





git clone https://[email protected]/teamname/my_projectname.git
cd my_projectname






To generate a token: GitHub → Settings → Developer settings → Personal access tokens → Tokens (classic) → Generate new token → Check repo









11. Build the Docker Image






docker build -t my_projectname .












12. Run the Docker Container






docker run -d --name my_projectname -p 8000:8000 my_projectname












13. Verify It's Running






# Check container status
docker ps

# Check logs
docker logs my_projectname












Verify Access



Open your browser and navigate to:




http://YOUR_EC2_PUBLIC_IP:8000/docs


Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten How to deploy Fast API

Thematisch verwandte Begriffe: deploy, Fast · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-77258 | MCP Atlassian is a Model Context Protocol (MCP) server for Atlassian pro…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick