Compare commits
3 commits
490443b63f
...
90be4d134b
| Author | SHA1 | Date | |
|---|---|---|---|
| 90be4d134b | |||
| 82842b3bf3 | |||
| b33997772b |
3 changed files with 18 additions and 21 deletions
|
|
@ -1,13 +1,6 @@
|
||||||
FROM python:3.12-slim
|
FROM python:3.12-slim
|
||||||
|
|
||||||
WORKDIR /app/modules/anime_etl
|
WORKDIR /app/modules/anime_etl
|
||||||
|
|
||||||
# RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
||||||
# build-essential \
|
|
||||||
# libpq-dev \
|
|
||||||
# ca-certificates \
|
|
||||||
# && rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
COPY modules/anime_etl/pyproject.toml modules/anime_etl/uv.lock ./
|
COPY modules/anime_etl/pyproject.toml modules/anime_etl/uv.lock ./
|
||||||
|
|
||||||
RUN pip install --no-cache-dir uv \
|
RUN pip install --no-cache-dir uv \
|
||||||
|
|
@ -17,5 +10,4 @@ COPY modules/anime_etl ./
|
||||||
|
|
||||||
ENV NYANIMEDB_MEDIA_ROOT=/media
|
ENV NYANIMEDB_MEDIA_ROOT=/media
|
||||||
|
|
||||||
# было: CMD ["python", "-m", "rabbit_worker"]
|
|
||||||
CMD ["uv", "run", "python", "-m", "rabbit_worker"]
|
CMD ["uv", "run", "python", "-m", "rabbit_worker"]
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,15 @@
|
||||||
FROM python:3.12-slim
|
FROM python:3.12-slim
|
||||||
|
|
||||||
# каталог внутри контейнера
|
|
||||||
WORKDIR /app/modules/image_storage
|
WORKDIR /app/modules/image_storage
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
||||||
ca-certificates \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# 1. зависимости через uv
|
|
||||||
COPY modules/image_storage/pyproject.toml modules/image_storage/uv.lock ./
|
COPY modules/image_storage/pyproject.toml modules/image_storage/uv.lock ./
|
||||||
|
|
||||||
RUN pip install --no-cache-dir uv \
|
RUN pip install --no-cache-dir uv \
|
||||||
&& uv sync --frozen --no-dev
|
&& uv sync --frozen --no-dev
|
||||||
|
|
||||||
# 2. сам код
|
|
||||||
COPY modules/image_storage ./
|
COPY modules/image_storage ./
|
||||||
|
|
||||||
# 3. где будем хранить файлы внутри контейнера
|
|
||||||
ENV NYANIMEDB_MEDIA_ROOT=/media
|
ENV NYANIMEDB_MEDIA_ROOT=/media
|
||||||
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
||||||
# 4. поднимаем FastAPI-приложение (app/main.py → app.main:app)
|
CMD ["uv", "run", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||||
CMD ["uv", "run", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { useState, useEffect } from "react";
|
||||||
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
|
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
|
||||||
import UserPage from "./pages/UserPage/UserPage";
|
import UserPage from "./pages/UserPage/UserPage";
|
||||||
import TitlesPage from "./pages/TitlesPage/TitlesPage";
|
import TitlesPage from "./pages/TitlesPage/TitlesPage";
|
||||||
|
|
@ -11,8 +12,22 @@ import { Header } from "./components/Header/Header";
|
||||||
// OpenAPI.WITH_CREDENTIALS = true
|
// OpenAPI.WITH_CREDENTIALS = true
|
||||||
|
|
||||||
const App: React.FC = () => {
|
const App: React.FC = () => {
|
||||||
// const username = localStorage.getItem("username") || undefined;
|
const [userId, setUserId] = useState<string | null>(localStorage.getItem("user_id"));
|
||||||
const userId = localStorage.getItem("user_id");
|
|
||||||
|
// 2. Listen for the same event the Header uses
|
||||||
|
useEffect(() => {
|
||||||
|
const handleAuthChange = () => {
|
||||||
|
setUserId(localStorage.getItem("user_id"));
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addEventListener("storage", handleAuthChange);
|
||||||
|
window.addEventListener("local-storage-update", handleAuthChange);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
window.removeEventListener("storage", handleAuthChange);
|
||||||
|
window.removeEventListener("local-storage-update", handleAuthChange);
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Router>
|
<Router>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue