Compare commits
No commits in common. "522e7554fedd69837d0c130afdd5b89498ab68ab" and "82842b3bf355a3f51e2e9f88c706be3121ef3455" have entirely different histories.
522e7554fe
...
82842b3bf3
3 changed files with 19 additions and 55 deletions
|
|
@ -1,54 +0,0 @@
|
||||||
name: Build and Deploy (frontend build only)
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- front
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
# Build frontend
|
|
||||||
- uses: actions/setup-node@v5
|
|
||||||
with:
|
|
||||||
node-version-file: modules/frontend/package.json
|
|
||||||
cache: npm
|
|
||||||
cache-dependency-path: modules/frontend/package-lock.json
|
|
||||||
|
|
||||||
- name: Build frontend
|
|
||||||
env:
|
|
||||||
VITE_BACKEND_API_BASE_URL: ${{ vars.BACKEND_API_BASE_URL }}
|
|
||||||
run: |
|
|
||||||
cd modules/frontend
|
|
||||||
npm install
|
|
||||||
npm run build
|
|
||||||
tar -czvf nyanimedb-frontend.tar.gz dist/
|
|
||||||
|
|
||||||
- name: Upload built frontend to artifactory
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: nyanimedb-frontend.tar.gz
|
|
||||||
path: modules/frontend/nyanimedb-frontend.tar.gz
|
|
||||||
|
|
||||||
# Build Docker images
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ${{ vars.REGISTRY }}
|
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build and push frontend image
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: Dockerfiles/Dockerfile_frontend
|
|
||||||
push: true
|
|
||||||
tags: meowgit.nekoea.red/nihonium/nyanimedb-frontend:latest
|
|
||||||
|
|
@ -1,6 +1,13 @@
|
||||||
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 \
|
||||||
|
|
@ -10,4 +17,5 @@ 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,15 +1,25 @@
|
||||||
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"]
|
||||||
Loading…
Add table
Add a link
Reference in a new issue