chore: add arm64 container deployment and Gitea CI
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
.git
|
||||
.gitea
|
||||
.github
|
||||
.venv
|
||||
.playwright
|
||||
__pycache__
|
||||
*.py[cod]
|
||||
*.log
|
||||
.env
|
||||
results
|
||||
screenshots
|
||||
@@ -0,0 +1,28 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v6
|
||||
with:
|
||||
version: "0.11.6"
|
||||
enable-cache: true
|
||||
|
||||
- name: Validate lockfile and install dependencies
|
||||
run: uv sync --locked --group runtime --group ml --group dev
|
||||
|
||||
- name: Compile Python sources
|
||||
run: uv run --frozen python -m compileall -q dashboard scrapers scoring backtesting ml ml_engine llm_client scripts orchestrator.py
|
||||
|
||||
- name: Run tests
|
||||
run: uv run --frozen pytest
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
# syntax=docker/dockerfile:1.7
|
||||
FROM ghcr.io/astral-sh/uv:0.11.6 AS uv
|
||||
FROM python:3.13.5-slim-bookworm
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
PLAYWRIGHT_BROWSERS_PATH=/ms-playwright \
|
||||
UV_COMPILE_BYTECODE=1 \
|
||||
UV_LINK_MODE=copy
|
||||
|
||||
COPY --from=uv /uv /uvx /bin/
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY pyproject.toml uv.lock ./
|
||||
RUN uv sync --frozen --no-install-project --no-dev --group runtime --group ml \
|
||||
&& uv run --frozen --no-dev --group runtime --group ml \
|
||||
playwright install --with-deps chromium \
|
||||
&& chmod -R a+rX /ms-playwright
|
||||
|
||||
COPY --chown=10001:10001 . .
|
||||
RUN mkdir -p /app/data /app/config \
|
||||
&& chown -R 10001:10001 /app/data /app/config
|
||||
|
||||
USER 10001:10001
|
||||
EXPOSE 3088
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
|
||||
CMD ["/app/.venv/bin/python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:3088/health/live', timeout=3)"]
|
||||
|
||||
CMD ["/app/.venv/bin/python", "-m", "uvicorn", "dashboard.server:app", "--host", "0.0.0.0", "--port", "3088"]
|
||||
@@ -0,0 +1,27 @@
|
||||
services:
|
||||
btc-monitor:
|
||||
build:
|
||||
context: .
|
||||
image: btc-accumulation-monitor:local
|
||||
ports:
|
||||
- "3088:3088"
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
PLAYWRIGHT_BROWSERS_PATH: /ms-playwright
|
||||
volumes:
|
||||
- btc-monitor-data:/app/data
|
||||
- btc-monitor-config:/app/config
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD
|
||||
- /app/.venv/bin/python
|
||||
- -c
|
||||
- "import urllib.request; urllib.request.urlopen('http://127.0.0.1:3088/health/live', timeout=3)"
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
start_period: 30s
|
||||
retries: 3
|
||||
|
||||
volumes:
|
||||
btc-monitor-data:
|
||||
btc-monitor-config:
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
cd "$ROOT"
|
||||
|
||||
export PYTHONPATH="${PYTHONPATH:-.}"
|
||||
export PLAYWRIGHT_BROWSERS_PATH="${PLAYWRIGHT_BROWSERS_PATH:-$ROOT/.playwright}"
|
||||
|
||||
exec uv run --frozen --no-dev --group runtime --group ml \
|
||||
python -m uvicorn dashboard.server:app --host 0.0.0.0 --port "${PORT:-3088}"
|
||||
Reference in New Issue
Block a user