RoBep / src /bce /website /Dockerfile
NielTT's picture
Upload 128 files
d8581cf verified
# Use Python 3.9 as base image
FROM python:3.9-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
g++ \
wget \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Set environment variables
ENV PYTHONPATH=/app
ENV BCE_HOST=0.0.0.0
ENV BCE_PORT=8000
# Copy requirements first for better caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the entire project
COPY . .
# Copy the parent directories to get the full project structure
COPY ../../../ /app/
# Create necessary directories
RUN mkdir -p /app/data/cache \
&& mkdir -p /app/models \
&& mkdir -p /tmp
# Expose port
EXPOSE 8000
# Health check
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8000/health || exit 1
# Run the application
CMD ["python", "run_server.py", "--host", "0.0.0.0", "--port", "8000"]