# ============================================================ # Dockerfile - S3 to Local Sync + Web Dashboard # ============================================================ # Immagine leggera basata su Alpine con: # - rclone: sincronizzazione da bucket S3-compatibili # - Flask: dashboard web in tempo reale (stile Syncthing) # - wget (incluso in BusyBox): notifiche push via Gotify # ============================================================ FROM alpine:3.21 # Installa le dipendenze: # - rclone: tool di sincronizzazione cloud storage # - python3 + pip: per il web server Flask # - tzdata: supporto timezone # - ca-certificates: certificati SSL per connessioni HTTPS # - tini: init process per gestione corretta dei segnali # - bash: shell per gli script # - findutils: find con supporto -printf per gli snapshot RUN apk add --no-cache \ rclone \ python3 \ py3-pip \ tzdata \ ca-certificates \ tini \ bash \ findutils # Installa Flask (web framework leggero per la dashboard) # --break-system-packages necessario su Alpine 3.21+ con Python 3.12+ RUN pip3 install --no-cache-dir --break-system-packages flask # Crea le directory di lavoro RUN mkdir -p /data/local /data/state /app # Copia l'applicazione web COPY web/ /app/web/ # Copia gli script COPY sync.sh /usr/local/bin/sync.sh COPY entrypoint.sh /usr/local/bin/entrypoint.sh RUN chmod +x /usr/local/bin/sync.sh /usr/local/bin/entrypoint.sh # Porta esposta per la dashboard web (configurabile via WEB_PORT) EXPOSE 8080 # Usa tini come init per gestire correttamente i segnali (SIGTERM, etc.) ENTRYPOINT ["/sbin/tini", "--"] # Avvia l'entrypoint che gestisce sia web che sync CMD ["/usr/local/bin/entrypoint.sh"]