fix:优化dockerfile

master
HuangHuiKang 2 weeks ago
parent 478e9838e0
commit 3a20180b6f

@ -1,5 +1,7 @@
.git .git
.gitignore .gitignore
.idea
.vscode
.pytest_cache .pytest_cache
.ruff_cache .ruff_cache
.venv .venv
@ -9,6 +11,9 @@ __pycache__
logs logs
tests tests
sql sql
static/upload
static/download
static/invoice
env/.env.dev env/.env.dev
env/.env.prod env/.env.prod
Dockerfile Dockerfile

@ -7,10 +7,10 @@
<value> <value>
<TabSessionState> <TabSessionState>
<option name="provider" value="codex" /> <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="cwd" value="$PROJECT_DIR$" />
<option name="model" value="gpt-5.5" /> <option name="model" value="gpt-5.5" />
<option name="permissionMode" value="acceptEdits" /> <option name="permissionMode" value="default" />
<option name="reasoningEffort" value="high" /> <option name="reasoningEffort" value="high" />
</TabSessionState> </TabSessionState>
</value> </value>

@ -4,15 +4,26 @@
<mappings /> <mappings />
<preferences /> <preferences />
</component> </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"> <component name="DBNavigator.Project.DatabaseAssistantManager">
<assistants /> <assistants />
<selection-state> <selection-state>
<model-selection /> <model-selection />
</selection-state> </selection-state>
</component> </component>
<component name="DBNavigator.Project.DatabaseEditorStateManager">
<last-used-providers />
</component>
<component name="DBNavigator.Project.DatabaseFileManager"> <component name="DBNavigator.Project.DatabaseFileManager">
<open-files /> <open-files />
</component> </component>
<component name="DBNavigator.Project.DatabasePrerequisiteManager">
<prerequisites />
</component>
<component name="DBNavigator.Project.Settings"> <component name="DBNavigator.Project.Settings">
<connections /> <connections />
<browser-settings> <browser-settings>
@ -448,4 +459,8 @@
</environment> </environment>
</general-settings> </general-settings>
</component> </component>
<component name="DBNavigator.Project.StatementExecutionManager">
<execution-variables />
<execution-variable-types />
</component>
</project> </project>

@ -1,8 +1,10 @@
# syntax=docker/dockerfile:1.7
FROM python:3.12-slim AS runtime FROM python:3.12-slim AS runtime
ENV PYTHONDONTWRITEBYTECODE=1 \ ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \ PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \ PIP_NO_CACHE_DIR=0 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \ PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/ \ PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/ \
PIP_TRUSTED_HOST=mirrors.aliyun.com \ PIP_TRUSTED_HOST=mirrors.aliyun.com \
@ -14,7 +16,9 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
WORKDIR /app 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 \ && apt-get install -y --no-install-recommends \
curl \ curl \
fontconfig \ fontconfig \
@ -25,10 +29,11 @@ RUN apt-get update \
libpangocairo-1.0-0 \ libpangocairo-1.0-0 \
shared-mime-info \ shared-mime-info \
tzdata \ tzdata \
&& rm -rf /var/lib/apt/lists/* && true
COPY requirements.txt ./ 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.ini main.py banner.txt ./
COPY alembic ./alembic COPY alembic ./alembic

Loading…
Cancel
Save