diff --git a/.dockerignore b/.dockerignore index 050420e..defb938 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,7 @@ .git .gitignore +.idea +.vscode .pytest_cache .ruff_cache .venv @@ -9,6 +11,9 @@ __pycache__ logs tests sql +static/upload +static/download +static/invoice env/.env.dev env/.env.prod Dockerfile diff --git a/.idea/claudeCodeTabState.xml b/.idea/claudeCodeTabState.xml index 0eb1afb..339c3e4 100644 --- a/.idea/claudeCodeTabState.xml +++ b/.idea/claudeCodeTabState.xml @@ -7,10 +7,10 @@ diff --git a/.idea/dbnavigator.xml b/.idea/dbnavigator.xml index dadbaaa..0e47829 100644 --- a/.idea/dbnavigator.xml +++ b/.idea/dbnavigator.xml @@ -4,15 +4,26 @@ + + + + + + + + + + + @@ -448,4 +459,8 @@ + + + + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 0218b65..758b4f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,10 @@ +# syntax=docker/dockerfile:1.7 + FROM python:3.12-slim AS runtime ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 \ - PIP_NO_CACHE_DIR=1 \ + PIP_NO_CACHE_DIR=0 \ PIP_DISABLE_PIP_VERSION_CHECK=1 \ PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/ \ PIP_TRUSTED_HOST=mirrors.aliyun.com \ @@ -14,7 +16,9 @@ ENV PYTHONDONTWRITEBYTECODE=1 \ WORKDIR /app -RUN apt-get update \ +RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ + --mount=type=cache,target=/var/lib/apt/lists,sharing=locked \ + apt-get update \ && apt-get install -y --no-install-recommends \ curl \ fontconfig \ @@ -25,10 +29,11 @@ RUN apt-get update \ libpangocairo-1.0-0 \ shared-mime-info \ tzdata \ - && rm -rf /var/lib/apt/lists/* + && true COPY requirements.txt ./ -RUN pip install --no-cache-dir -r requirements.txt +RUN --mount=type=cache,target=/root/.cache/pip \ + pip install --prefer-binary -r requirements.txt COPY alembic.ini main.py banner.txt ./ COPY alembic ./alembic