Update Docker runtime to pull latest code on startup.

Install git in image and change start script to clone/pull target branch, reinstall dependencies, rebuild frontend, then launch backend and frontend services.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
renjue
2026-05-09 16:19:18 +08:00
parent 82581d2949
commit 7e3f4d792f
3 changed files with 34 additions and 17 deletions

View File

@@ -3,24 +3,11 @@ FROM node:20-bookworm-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends python3 python3-pip ca-certificates \
&& apt-get install -y --no-install-recommends python3 python3-pip ca-certificates git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install backend dependencies.
COPY backend/requirements.txt /app/backend/requirements.txt
RUN python3 -m pip install --no-cache-dir -r /app/backend/requirements.txt
# Install frontend dependencies and build.
COPY frontend/package*.json /app/frontend/
WORKDIR /app/frontend
RUN npm install
COPY frontend /app/frontend
RUN npm run build
# Copy backend source and runtime launcher.
WORKDIR /app
COPY backend /app/backend
COPY docker/start.sh /app/docker/start.sh
RUN chmod +x /app/docker/start.sh