# Use official Swift toolchain on Ubuntu Jammy (non-slim to ensure Swift is pre-installed)
FROM swift:jammy
# Install build-time dependencies (for Linux GPUImage and OpenGL)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libgd-dev libjpeg-dev libpng-dev libtiff-dev \
libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev \
libv4l-dev pkg-config \
&& rm -rf /var/lib/apt/lists/*
# Create and set working directory
WORKDIR /workspace
# Copy source
COPY . .
# Build the project from source
RUN swift build -c release
# Default to an interactive shell so the container can be inspected
CMD ["/bin/bash"]