created project

This commit is contained in:
2026-07-14 13:52:35 +03:00
parent 768d64ed28
commit f774ae084e
5 changed files with 39 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
__pycache__/
*.pyc
*.pyo
*.pyd
.git
.gitignore
.env
venv/
.venv/
+21
View File
@@ -0,0 +1,21 @@
# Use an official lightweight Python image
FROM python:3.12-slim
# Prevent Python from writing .pyc files and enable real-time logging
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Set the working directory inside the container
WORKDIR /code
# Copy only the dependency definitions to maximize Docker cache utilization
COPY ./requirements.txt /code/requirements.txt
# Install the application dependencies
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Copy the rest of the application code
COPY ./app /code/app
# Run the FastAPI application using the official CLI
CMD ["fastapi", "run", "app/main.py", "--port", "80"]
View File
+9
View File
@@ -0,0 +1,9 @@
from fastapi import FastAPI
# Создаем само приложение
app = FastAPI()
# Вешаем обработчик на главную страницу
@app.get("/")
def read_root():
return {"message": "Hello, world!"}
View File