Skip to content

Commit

Permalink
feat: added backend import export docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
whiteyebrw committed Dec 11, 2024
1 parent 87d8108 commit 5a9c577
Show file tree
Hide file tree
Showing 6 changed files with 754 additions and 9 deletions.
13 changes: 13 additions & 0 deletions packages/backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:3.11-slim

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install 'pydantic[email]'

Check failure on line 7 in packages/backend/Dockerfile

View workflow job for this annotation

GitHub Actions / Проверка наличия тега 0.8 и работоспособности docker-compose

DL3013 warning: Pin versions in pip. Instead of `pip install <package>` use `pip install <package>==<version>` or `pip install --requirement <requirements file>`

Check failure on line 7 in packages/backend/Dockerfile

View workflow job for this annotation

GitHub Actions / Проверка наличия тега 0.8 и работоспособности docker-compose

DL3042 warning: Avoid use of cache directory with pip. Use `pip install --no-cache-dir <package>`

Check failure on line 7 in packages/backend/Dockerfile

View workflow job for this annotation

GitHub Actions / Проверка наличия тега 0.8 и работоспособности docker-compose

DL3059 info: Multiple consecutive `RUN` instructions. Consider consolidation.

COPY . .

EXPOSE 8000

CMD ["python", "./app/main.py"]
7 changes: 6 additions & 1 deletion packages/backend/app/server/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware

from server.routes.routes import router
from server.routes.routes import router, load_dump_if_empty

app = FastAPI()

Expand All @@ -20,6 +20,11 @@
app.include_router(router)


@app.on_event("startup")
async def on_startup():
await load_dump_if_empty()


@app.get("/", tags=["Root"])
async def read_root():
return {"message": "Welcome to this fantastic app!"}
Loading

0 comments on commit 5a9c577

Please sign in to comment.