This commit is contained in:
2025-04-21 15:40:56 +02:00
parent abe0cbb173
commit cfce98a42f
9 changed files with 55 additions and 60 deletions

View File

@@ -49,26 +49,26 @@ jobs:
with:
url: ${{ secrets.WEBHOOK_URL }}
-
name: Invoke deployment hook (worker)
uses: joelwmale/webhook-action@master
with:
url: ${{ secrets.WEBHOOK_URL_2 }}
# -
# name: Invoke deployment hook (worker)
# uses: joelwmale/webhook-action@master
# with:
# url: ${{ secrets.WEBHOOK_URL_2 }}
-
name: Invoke deployment hook (scheduler)
uses: joelwmale/webhook-action@master
with:
url: ${{ secrets.WEBHOOK_URL_3 }}
# -
# name: Invoke deployment hook (scheduler)
# uses: joelwmale/webhook-action@master
# with:
# url: ${{ secrets.WEBHOOK_URL_3 }}
-
name: Invoke deployment hook (stream_notifications)
uses: joelwmale/webhook-action@master
with:
url: ${{ secrets.WEBHOOK_URL_4 }}
# -
# name: Invoke deployment hook (stream_notifications)
# uses: joelwmale/webhook-action@master
# with:
# url: ${{ secrets.WEBHOOK_URL_4 }}
-
name: Invoke deployment hook (web_app)
uses: joelwmale/webhook-action@master
with:
url: ${{ secrets.WEBHOOK_URL_5 }}
# -
# name: Invoke deployment hook (web_app)
# uses: joelwmale/webhook-action@master
# with:
# url: ${{ secrets.WEBHOOK_URL_5 }}

View File

@@ -1,19 +1,22 @@
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim AS builder
COPY ./scripts/*.sh /
WORKDIR /opt/
COPY ./pyproject.toml ./uv.lock ./
RUN --mount=type=ssh uv venv \
&& uv sync --frozen
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim
ENV PATH="/opt/venv/bin:$PATH"
COPY ./src /app
COPY --from=builder /opt/.venv /opt/venv
COPY ./docker/*.sh /
RUN chmod +x /*.sh
WORKDIR /app
COPY ./pyproject.toml ./
COPY ./uv.lock ./
RUN uv venv && uv sync --frozen
COPY ./src ./src
ENV PATH="/app/.venv/bin:$PATH"
EXPOSE 80
CMD ["uv", "run", "src/main.py"]
ENTRYPOINT ["uv", "run"]

View File

@@ -1,3 +1,5 @@
#! /usr/bin/env sh
uv run ./src/main.py $1
cd src
uv run $1

View File

@@ -1,3 +0,0 @@
#! /usr/bin/env sh
uv run --directory src taskiq scheduler core.broker:scheduler modules.tasks

View File

@@ -1,3 +0,0 @@
#! /usr/bin/env sh
uv run --directory src uvicorn modules.web_app.app:app --host 0.0.0.0 --port 80

View File

@@ -1,3 +0,0 @@
#! /usr/bin/env sh
uv run --directory src taskiq worker core.broker:broker modules.tasks

View File

@@ -1,7 +0,0 @@
from .discord import start_discord_sevice
start = start_discord_sevice
__all__ = ["start"]

View File

@@ -0,0 +1,13 @@
from asyncio import run
from applications.games_list.discord import client, logger
from core.config import config
async def start_discord_sevice():
logger.info("Starting Discord service...")
await client.start(config.DISCORD_BOT_TOKEN)
run(start_discord_sevice())

View File

@@ -5,10 +5,9 @@ from discord.abc import Messageable
from discord import Object
from discord import app_commands
from modules.games_list.games_list import GameList, GameItem
from applications.common.repositories.streamers import StreamerConfigRepository
from applications.games_list.games_list import GameList, GameItem
from core.config import config
from repositories.streamers import StreamerConfigRepository
logger = logging.getLogger(__name__)
@@ -240,9 +239,3 @@ async def replace(interaction: discord.Interaction, game: str, new: str):
await game_list.save()
await interaction.response.send_message("Игра заменена!", ephemeral=True)
async def start_discord_sevice():
logger.info("Starting Discord service...")
await client.start(config.DISCORD_BOT_TOKEN)