diff --git a/.github/workflow/docker-image.yml b/.github/workflow/docker-image.yml new file mode 100644 index 0000000..312c4fb --- /dev/null +++ b/.github/workflow/docker-image.yml @@ -0,0 +1,15 @@ +name: Build and Publish image to Docker Hub +on: + push: + branches: + - main + +jobs: + publish_images: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v4 + - name: build image + run: | + docker build . -t arnaudcayrol/immich-selfie-timelapse:latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bc9373c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,45 @@ +FROM python:3.10-slim + +# Install system dependencies required for OpenCV and dlib +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + cmake \ + ffmpeg \ + libsm6 \ + libxext6 \ + libxrender-dev \ + libgl1-mesa-glx \ + && rm -rf /var/lib/apt/lists/* + +# Set working directory +WORKDIR /app + +# Copy requirements first to leverage Docker cache +COPY requirements.txt . + +# Install Python dependencies +RUN pip install --no-cache-dir -r requirements.txt + +# Download the shape predictor model +RUN apt-get update && apt-get install -y wget && \ + wget -nd https://github.com/JeffTrain/selfie/raw/master/shape_predictor_68_face_landmarks.dat && \ + apt-get remove -y wget && \ + apt-get autoremove -y && \ + rm -rf /var/lib/apt/lists/* + +# Copy the application code +COPY image_processing.py . +COPY main.py . +COPY templates/ templates/. +COPY compile_timelapse.py . +COPY immich_api.py . + +# Create output directory +RUN mkdir -p /app/output + + +# Expose the port the app runs on +EXPOSE 5000 + +# Command to run the application +CMD ["python", "main.py"] \ No newline at end of file