Dockerfiles added
This commit is contained in:
parent
9b2e9bd45a
commit
f983ed1035
2 changed files with 46 additions and 0 deletions
21
Dockerfiles/Dockerfile_etl
Normal file
21
Dockerfiles/Dockerfile_etl
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
FROM python:3.12-slim
|
||||
|
||||
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 ./
|
||||
|
||||
RUN pip install --no-cache-dir uv \
|
||||
&& uv sync --frozen --no-dev
|
||||
|
||||
COPY modules/anime_etl ./
|
||||
|
||||
ENV NYANIMEDB_MEDIA_ROOT=/media
|
||||
|
||||
# было: CMD ["python", "-m", "rabbit_worker"]
|
||||
CMD ["uv", "run", "python", "-m", "rabbit_worker"]
|
||||
25
Dockerfiles/Dockerfile_image_storage
Normal file
25
Dockerfiles/Dockerfile_image_storage
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
FROM python:3.12-slim
|
||||
|
||||
# каталог внутри контейнера
|
||||
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 ./
|
||||
|
||||
RUN pip install --no-cache-dir uv \
|
||||
&& uv sync --frozen --no-dev
|
||||
|
||||
# 2. сам код
|
||||
COPY modules/image_storage ./
|
||||
|
||||
# 3. где будем хранить файлы внутри контейнера
|
||||
ENV NYANIMEDB_MEDIA_ROOT=/media
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
# 4. поднимаем FastAPI-приложение (app/main.py → app.main:app)
|
||||
CMD ["uv", "run", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue