wallpapers/Dockerfile

33 lines
1 KiB
Docker
Raw Permalink Normal View History

2026-06-19 10:03:14 +00:00
# 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
2026-06-07 11:14:44 +00:00
WORKDIR /app
COPY . .
RUN cargo build --release --bin scrape
2026-06-19 10:03:14 +00:00
FROM ubuntu:24.04
# Installation des dépendances nécessaires
2026-06-07 11:14:44 +00:00
RUN apt-get update && apt-get install -y \
ca-certificates \
libssl3 \
2026-06-19 10:03:14 +00:00
python3 \
git \
ssh \
2026-06-07 11:14:44 +00:00
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /app/target/release/scrape /usr/local/bin/scrape
2026-06-19 10:03:14 +00:00
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"]