diff --git a/backend/.dockerignore b/backend/.dockerignore new file mode 100644 index 0000000..b9a69ed --- /dev/null +++ b/backend/.dockerignore @@ -0,0 +1,17 @@ +*.pyc +*.pyo +__pycache__/ +venv/ +env/ +*.vscode/ +.idea/ +*.swp +.DS_Store +Thumbs.db +.git/ +.gitignore +images/ +*.log +*.pid +run.bat +run-server.ps1 diff --git a/backend/Dockerfile b/backend/Dockerfile index b48acb8..df797f7 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,24 +1,31 @@ -FROM python:3.10.12-slim +FROM python:3.10.12-slim AS build WORKDIR /app -RUN apt-get update && apt-get install -y \ +RUN apt-get update && apt-get install -y --no-install-recommends \ libgl1-mesa-glx \ libglib2.0-0 \ && rm -rf /var/lib/apt/lists/* -COPY requirements.txt /app/requirements.txt +COPY requirements.txt /app/ + +FROM python:3.10.12-slim + +WORKDIR /app + +RUN apt-get update && apt-get install -y --no-install-recommends \ + libgl1-mesa-glx \ + libglib2.0-0 \ + && rm -rf /var/lib/apt/lists/* +COPY requirements.txt /app/ RUN pip install --no-cache-dir -r requirements.txt -RUN pip uninstall uvcorn -COPY . /app +COPY . /app/ -RUN chmod +x run.sh -RUN mkdir ../images +RUN chmod +x run.sh && mkdir -p ../images EXPOSE 8000 - ENV WORKERS=1 CMD ["./run.sh"]