Single part at the root, COMPOSE_FILE in .env
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
{%- set svc_modules = [] -%}
|
||||
{%- if 'api' in backend_services %}{% set _ = svc_modules.append("api") %}{% endif -%}
|
||||
{%- if 'aiogram_bot' in backend_services %}{% set _ = svc_modules.append("bot") %}{% endif -%}
|
||||
{%- if 'taskiq_worker' in backend_services %}{% set _ = svc_modules.append("worker") %}{% endif -%}
|
||||
{%- if 'kurigram_userbot' in backend_services %}{% set _ = svc_modules.append("userbot") %}{% endif -%}
|
||||
{%- if 'scheduler' in backend_services and 'taskiq_worker' not in backend_services %}{% set _ = svc_modules.append("scheduler") %}{% endif -%}
|
||||
{%- if 'kurigram_userbot' in backend_services -%}
|
||||
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim
|
||||
|
||||
RUN apt-get update && apt-get install -y build-essential && rm -rf /var/lib/apt/lists/*
|
||||
{%- else -%}
|
||||
FROM ghcr.io/astral-sh/uv:python3.13-alpine
|
||||
{%- endif %}
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV PATH="/app/.venv/bin:$PATH" \
|
||||
RUN_ENVIRONMENT=prod \
|
||||
UV_COMPILE_BYTECODE=1 \
|
||||
UV_LINK_MODE=copy
|
||||
|
||||
COPY pyproject.toml uv.lock ./
|
||||
RUN uv sync --frozen --no-install-project --no-dev
|
||||
|
||||
COPY src ./src
|
||||
RUN uv sync --frozen --no-dev
|
||||
{%- if database == 'postgres' %}
|
||||
|
||||
COPY alembic.ini ./
|
||||
COPY migrations ./migrations
|
||||
{%- endif %}
|
||||
{%- if dynamic_config or 'kurigram_userbot' in backend_services %}
|
||||
|
||||
COPY scripts ./scripts
|
||||
{%- endif %}
|
||||
|
||||
ENTRYPOINT ["python", "-m"]
|
||||
{%- if svc_modules %}
|
||||
CMD ["{{ svc_modules[0] }}"]
|
||||
{%- endif %}
|
||||
Reference in New Issue
Block a user