mirror of
https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools.git
synced 2026-06-17 23:09:35 +00:00
fix: rewrite Dockerfile single-stage — kill Railway cache completely
https://claude.ai/code/session_01W1rJthWDkasijTdXCfxVHs
This commit is contained in:
parent
28ea22868f
commit
374886259f
@ -1,42 +1,19 @@
|
|||||||
# ── Stage 1: Builder ──────────────────────────────────
|
FROM python:3.12-slim
|
||||||
FROM python:3.12-slim AS builder
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
build-essential libpq-dev curl \
|
build-essential libpq-dev libpq5 curl tini libxml2 libxslt1.1 \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /app
|
||||||
|
|
||||||
RUN python -m venv /opt/venv
|
|
||||||
ENV PATH="/opt/venv/bin:$PATH"
|
|
||||||
|
|
||||||
COPY requirements.txt ./
|
COPY requirements.txt ./
|
||||||
ARG CACHEBUST=2
|
|
||||||
RUN pip install --no-cache-dir --upgrade pip setuptools wheel \
|
RUN pip install --no-cache-dir --upgrade pip setuptools wheel \
|
||||||
&& pip install --no-cache-dir -r requirements.txt
|
&& pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
# ── Stage 2: Runtime ─────────────────────────────────
|
COPY . .
|
||||||
FROM python:3.12-slim AS runtime
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
||||||
libpq5 curl tini libxml2 libxslt1.1 \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
RUN groupadd --gid 1000 app \
|
|
||||||
&& useradd --uid 1000 --gid app --shell /bin/bash --create-home app
|
|
||||||
|
|
||||||
COPY --from=builder /opt/venv /opt/venv
|
|
||||||
ENV PATH="/opt/venv/bin:$PATH" \
|
|
||||||
PYTHONUNBUFFERED=1 \
|
|
||||||
PYTHONDONTWRITEBYTECODE=1
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
ARG APP_CACHEBUST=3
|
|
||||||
COPY --chown=app:app . .
|
|
||||||
RUN chmod +x start.sh
|
RUN chmod +x start.sh
|
||||||
|
|
||||||
USER app
|
ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1
|
||||||
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
||||||
ENTRYPOINT ["tini", "--"]
|
ENTRYPOINT ["tini", "--"]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user