File size: 852 Bytes
250c48b 25f22bf 90698bc ea1993f 90698bc 25f22bf 90698bc |
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 |
FROM python:3.11
WORKDIR /app
# Install system dependencies including Redis server
# Install Node.js for frontend build
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
RUN apt-get update && apt-get install -y \
redis-server \
nodejs \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy and install Python dependencies
COPY requirements.txt .
RUN pip install -r requirements.txt
# Copy package files for frontend
COPY frontend/package*.json ./frontend/
# Install frontend dependencies
RUN cd frontend && npm install
# Copy all files
COPY . .
# Build frontend
RUN cd frontend && npm run build
# Make the startup script executable
RUN chmod +x start_app.py
# Expose port
EXPOSE 7860
# Start Redis server in background and then start the application
CMD ["sh", "-c", "redis-server --daemonize yes && python start_app.py"] |