Added docker functionality.

This commit is contained in:
Aodhan
2025-06-25 22:26:49 +01:00
parent c5391a957d
commit 7bebc95c09
8 changed files with 126 additions and 11 deletions

27
Dockerfile Normal file
View File

@@ -0,0 +1,27 @@
# Dockerfile for SWIPER image-swipe application
# ------------------------------------------------
# This image runs the built-in Python HTTP server provided by server.py.
# Pillow needs system libs so we install them via apt.
FROM python:3.11-slim
# Install system packages required by Pillow (JPEG, zlib)
RUN apt-get update \
&& apt-get install -y --no-install-recommends build-essential libjpeg-dev zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
# Set work directory
WORKDIR /app
# Install Python dependencies first (leverages Docker layer caching)
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy application source
COPY . .
# Expose the default port
EXPOSE 8888
# Start the server
CMD ["python", "server.py"]