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:
15
Dockerfile
15
Dockerfile
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user