fix:优化dockerfile

master
HuangHuiKang 17 hours ago
parent 478e9838e0
commit 3a20180b6f

@ -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

@ -7,10 +7,10 @@
<value>
<TabSessionState>
<option name="provider" value="codex" />
<option name="sessionId" value="019f2248-8e43-7ea3-81b1-1a0a3d35311b" />
<option name="sessionId" value="019f44e1-0700-78a1-a13a-3ab17c6444bd" />
<option name="cwd" value="$PROJECT_DIR$" />
<option name="model" value="gpt-5.5" />
<option name="permissionMode" value="acceptEdits" />
<option name="permissionMode" value="default" />
<option name="reasoningEffort" value="high" />
</TabSessionState>
</value>

@ -4,15 +4,26 @@
<mappings />
<preferences />
</component>
<component name="DBNavigator.Project.DataEditorManager">
<record-view-column-sorting-type value="BY_INDEX" />
<value-preview-text-wrapping value="true" />
<value-preview-pinned value="false" />
</component>
<component name="DBNavigator.Project.DatabaseAssistantManager">
<assistants />
<selection-state>
<model-selection />
</selection-state>
</component>
<component name="DBNavigator.Project.DatabaseEditorStateManager">
<last-used-providers />
</component>
<component name="DBNavigator.Project.DatabaseFileManager">
<open-files />
</component>
<component name="DBNavigator.Project.DatabasePrerequisiteManager">
<prerequisites />
</component>
<component name="DBNavigator.Project.Settings">
<connections />
<browser-settings>
@ -448,4 +459,8 @@
</environment>
</general-settings>
</component>
<component name="DBNavigator.Project.StatementExecutionManager">
<execution-variables />
<execution-variable-types />
</component>
</project>

@ -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

Loading…
Cancel
Save