first commit
This commit is contained in:
21
backend/Dockerfile
Normal file
21
backend/Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
gcc \
|
||||
libpq-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install python dependencies
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy application code
|
||||
COPY . .
|
||||
|
||||
# Run the application
|
||||
# We use reload for development
|
||||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
|
||||
8
backend/app/main.py
Normal file
8
backend/app/main.py
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
from fastapi import FastAPI
|
||||
|
||||
app = FastAPI(title="Auteur AI API")
|
||||
|
||||
@app.get("/")
|
||||
async def root():
|
||||
return {"message": "Auteur AI Backend is running"}
|
||||
15
backend/app/worker.py
Normal file
15
backend/app/worker.py
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
from celery import Celery
|
||||
import os
|
||||
|
||||
redis_url = os.getenv("REDIS_URL", "redis://redis:6379/0")
|
||||
|
||||
celery_app = Celery(
|
||||
"worker",
|
||||
broker=redis_url,
|
||||
backend=redis_url
|
||||
)
|
||||
|
||||
@celery_app.task
|
||||
def test_task():
|
||||
return "Worker is running"
|
||||
13
backend/requirements.txt
Normal file
13
backend/requirements.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
fastapi
|
||||
uvicorn[standard]
|
||||
sqlalchemy
|
||||
asyncpg
|
||||
alembic
|
||||
pydantic
|
||||
pydantic-settings
|
||||
boto3
|
||||
openai
|
||||
redis
|
||||
celery
|
||||
python-multipart
|
||||
Reference in New Issue
Block a user