Spaces:
Sleeping
Sleeping
| FROM python 3.10 | |
| FROM continuumio/miniconda3 | |
| RUN useradd user | |
| USER user | |
| COPY ./requirements.txt requirements.txt | |
| ENV PYTHONDONTWRITEBYTECODE=1 | |
| ENV PYTHONUNBUFFERED=1 | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy backend files | |
| COPY . /app | |
| # Create and activate conda env with Python 3.10 | |
| RUN conda create -n myenv python=3.10 -y && \ | |
| echo "conda activate myenv" >> ~/.bashrc && \ | |
| /bin/bash -c "source ~/.bashrc && conda activate myenv && pip install --upgrade pip && pip install -r requirements.txt" | |
| # Clone React frontend from GitHub | |
| RUN apt-get update && \ | |
| apt-get install -y git curl && \ | |
| git clone https://github.com/vijaysagi12/myinzackBot.git /frontend | |
| # Install Node.js & npm (for React) | |
| RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \ | |
| apt-get install -y nodejs && \ | |
| cd /frontend && npm install && npm run build | |
| # Expose Flask and React ports | |
| EXPOSE 5000 3000 | |
| # Start both Flask and React servers | |
| CMD ["/bin/bash", "-c", "source activate myenv && \ | |
| (cd /frontend && npm start &) && \ | |
| python app.py"] | |