CoolFace
Apppublic

Ratan1870/code-execution

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes
Dockerfile47 linesDownload Raw Back to root
1FROM node:20-slim2 3# Install compilers, Python, and required utilities4RUN apt-get update && apt-get install -y --no-install-recommends \5    gcc \6    g++ \7    python3 \8    coreutils \9    wget \10    curl \11    && rm -rf /var/lib/apt/lists/*12 13# Create app directory14WORKDIR /app15 16# Create temp directory for code execution17RUN mkdir -p /tmp/judge && chmod 777 /tmp/judge18 19# Copy package files and install dependencies20COPY package*.json ./21RUN npm ci --production22 23# Copy source code24COPY src/ ./src/25 26# Environment variables for Hugging Face Spaces27ENV NODE_ENV=production28ENV EXECUTION_MODE=process29ENV PORT=786030ENV TEMP_DIR=/tmp/judge31ENV MAX_CONCURRENT=232ENV DEFAULT_TIME_LIMIT=533ENV DEFAULT_MEMORY_LIMIT=25634ENV MAX_TIME_LIMIT=1035ENV MAX_MEMORY_LIMIT=51236ENV MAX_CODE_SIZE=6553637ENV RATE_LIMIT_WINDOW=6000038ENV RATE_LIMIT_MAX=3039 40EXPOSE 786041 42# Health check using curl (simpler than wget)43HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \44    CMD curl -f http://localhost:7860/api/health || exit 145 46CMD ["node", "src/index.js"]47