Spaces:
Runtime error
Runtime error
File size: 1,111 Bytes
5710d63 3f143e9 5710d63 3f143e9 7e6051f 5710d63 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | # Build frontend
FROM node:22-slim AS frontend-build
WORKDIR /app/frontend
COPY frontend/package.json frontend/package-lock.json* ./
RUN npm install
COPY frontend/ .
RUN npm run build
# Build backend
FROM node:22-slim AS backend-build
WORKDIR /app
COPY package.json package-lock.json* ./
COPY patches/ ./patches/
RUN npm install
COPY tsconfig.json ./
COPY src/ ./src/
RUN npm run build
# Production
FROM node:22-slim
WORKDIR /app
# Install Foundry dependencies
RUN apt-get update && apt-get install -y curl git && rm -rf /var/lib/apt/lists/*
# Install Foundry
RUN curl -L https://foundry.paradigm.xyz | bash
ENV PATH="/root/.foundry/bin:${PATH}"
RUN foundryup
COPY package.json package-lock.json* ./
COPY patches/ ./patches/
RUN npm install --omit=dev --ignore-scripts
COPY --from=backend-build /app/dist ./dist
COPY --from=frontend-build /app/frontend/dist ./frontend/dist
ENV PORT=7860
EXPOSE 7860
# Ensure scripts are executable
COPY scripts/ ./scripts/
RUN chmod +x scripts/*.sh
# Run sandbox setup once during image build to cache it
RUN ./scripts/setup-sandbox.sh
CMD ["node", "dist/server.js"]
|