diff --git a/Dockerfile.web b/Dockerfile.web new file mode 100644 index 0000000..ea27e9b --- /dev/null +++ b/Dockerfile.web @@ -0,0 +1,16 @@ +FROM python:3.11-slim + +WORKDIR /app + +RUN pip install --no-cache-dir \ + fastapi==0.115.0 \ + uvicorn==0.30.0 \ + python-multipart==0.0.9 \ + redis==5.0.0 \ + rq==1.16.0 + +COPY server.py . + +ENV RESULTS_DIR=/data/results +EXPOSE 8000 +CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "8000"] diff --git a/Dockerfile.worker b/Dockerfile.worker new file mode 100644 index 0000000..e652415 --- /dev/null +++ b/Dockerfile.worker @@ -0,0 +1,27 @@ +FROM python:3.11-slim + +RUN apt-get update && apt-get install -y --no-install-recommends \ + wget xz-utils ca-certificates \ + libgtk-3-0t64 libdrm2 libgbm1 libxcb-dri3-0 \ + inkscape \ + && rm -rf /var/lib/apt/lists/* + +ARG INKSTITCH_VERSION=3.2.2 +RUN ARCH=$(dpkg --print-architecture) && \ + if [ "$ARCH" = "arm64" ]; then INKARCH="aarch64"; else INKARCH="x86_64"; fi && \ + wget -q "https://github.com/inkstitch/inkstitch/releases/download/v${INKSTITCH_VERSION}/inkstitch-${INKSTITCH_VERSION}-linux-${INKARCH}.tar.xz" \ + -O /tmp/inkstitch.tar.xz && \ + mkdir -p /opt/inkstitch && \ + tar xJf /tmp/inkstitch.tar.xz -C /opt/inkstitch && \ + rm /tmp/inkstitch.tar.xz +ENV INKSTITCH_BIN=/opt/inkstitch/inkstitch/bin/inkstitch + +WORKDIR /app +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +COPY pipeline/ pipeline/ +COPY worker.py . + +ENV RESULTS_DIR=/data/results +CMD ["rq", "worker", "patches", "--url", "redis://redis:6379"]