| |
| FROM python:3.11-slim |
|
|
| |
| ENV DEBIAN_FRONTEND=noninteractive \ |
| PYTHONUNBUFFERED=1 \ |
| UV_SYSTEM_PYTHON=1 |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| curl \ |
| git \ |
| nginx \ |
| build-essential \ |
| python3-dev \ |
| libgl1 \ |
| libglib2.0-0 \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ |
| apt-get install -y nodejs |
|
|
| |
| RUN pip install --no-cache-dir uv |
|
|
| |
| WORKDIR /app |
|
|
| |
| RUN git clone https://github.com/666ghj/MiroFish.git /tmp/repo && \ |
| cp -r /tmp/repo/* . && \ |
| rm -rf /tmp/repo |
|
|
| |
| COPY . . |
|
|
| |
| WORKDIR /app/backend |
| RUN rm -f uv.lock && \ |
| if [ -f pyproject.toml ]; then \ |
| echo "Found pyproject.toml, exporting requirements..."; \ |
| |
| uv export --format requirements-txt --output-file export_req.txt; \ |
| |
| sed -i '/^-e/d' export_req.txt; \ |
| |
| pip install --no-cache-dir -r export_req.txt; \ |
| elif [ -f requirements.txt ]; then \ |
| pip install --no-cache-dir -r requirements.txt; \ |
| else \ |
| echo "No dependencies found, skipping..."; \ |
| fi |
|
|
| |
| WORKDIR /app/frontend |
| RUN npm install --legacy-peer-deps |
|
|
| |
| RUN rm -f /etc/nginx/sites-enabled/default |
| COPY nginx.conf /etc/nginx/conf.d/default.conf |
|
|
| |
| WORKDIR /app |
| COPY start.sh . |
| RUN chmod +x start.sh |
|
|
| |
| RUN chmod -R 777 /app && \ |
| chmod -R 777 /var/log/nginx && \ |
| chmod -R 777 /var/lib/nginx && \ |
| mkdir -p /var/run/nginx && \ |
| chmod -R 777 /var/run/nginx |
|
|
| EXPOSE 7860 |
|
|
| CMD ["./start.sh"] |