Spaces:
Sleeping
Sleeping
| FROM python:3.11-slim-bullseye AS base | |
| # Create a user for security | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy and install Python dependencies | |
| COPY --chown=user ./requirements.txt requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt || echo "No requirements.txt found, skipping." | |
| # Copy application files | |
| COPY --chown=user . /app | |
| # Install Node.js separately | |
| FROM node:20-slim AS nodebuilder | |
| WORKDIR /app | |
| COPY --from=base /app /app | |
| # Install Node.js dependencies | |
| RUN npm install --production | |
| # Expose port 3000 for the website | |
| EXPOSE 3000 | |
| # Start the Node.js server and optionally run Python bots | |
| CMD ["/bin/bash", "-c", "node server.js & python3 bot1.py & python3 bot2.py"] | |