wallpapers/Dockerfile
2026-06-19 12:03:14 +02:00

33 lines
1 KiB
Docker

# Utilise Ubuntu 24.04 pour avoir des bibliothèques systèmes à jour
FROM rust:latest AS builder
# (Rust 1.78 est très récent et gère parfaitement le format lock v4)
RUN apt-get update && apt-get install -y cmake nasm clang libssl-dev pkg-config
WORKDIR /app
COPY . .
RUN cargo build --release --bin scrape
FROM ubuntu:24.04
# Installation des dépendances nécessaires
RUN apt-get update && apt-get install -y \
ca-certificates \
libssl3 \
python3 \
git \
ssh \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /app/target/release/scrape /usr/local/bin/scrape
COPY generate_readme.py /app/generate_readme.py
RUN echo '#!/bin/sh\n\
git config --global user.email "bot@periodicbrake.fr"\n\
git config --global user.name "Wallpaper Bot"\n\
/usr/local/bin/scrape\n\
python3 /app/generate_readme.py\n\
git add README*.md assets/*.json\n\
git diff --exit-code > /dev/null || (git commit -m "chore: auto-update" && git push)\n\
' > /app/run.sh && chmod +x /app/run.sh
CMD ["/app/run.sh"]