Initial commit
This commit is contained in:
+39
@@ -0,0 +1,39 @@
|
||||
FROM debian:trixie-slim
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
apt-mirror \
|
||||
cron \
|
||||
nginx \
|
||||
xz-utils \
|
||||
ca-certificates \
|
||||
liblwp-protocol-https-perl && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create mirror directory with proper ownership
|
||||
RUN mkdir -p /mirror && \
|
||||
chown -R apt-mirror:apt-mirror /mirror
|
||||
|
||||
# Copy user-provided mirror.list at build time
|
||||
COPY mirror.list /etc/apt/mirror.list
|
||||
|
||||
# Configure cron job for daily sync at 02:00 UTC
|
||||
RUN echo "0 2 * * * apt-mirror > /var/log/apt-mirror.log 2>&1" | crontab -u apt-mirror -
|
||||
|
||||
COPY nginx.conf /etc/nginx/sites-available/mirror
|
||||
# Create directories explicitly before linking
|
||||
RUN mkdir -p /etc/nginx/sites-available /etc/nginx/sites-enabled && \
|
||||
ln -s /etc/nginx/sites-available/mirror /etc/nginx/sites-enabled/mirror && \
|
||||
rm -f /etc/nginx/sites-enabled/default
|
||||
|
||||
# Entrypoint handles initial sync and starts cron in foreground
|
||||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||
RUN chmod +x /usr/local/bin/entrypoint.sh
|
||||
|
||||
VOLUME ["/mirror"]
|
||||
WORKDIR /mirror
|
||||
|
||||
USER apt-mirror
|
||||
EXPOSE 80
|
||||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo "[$(date)] Initial mirror sync starting..."
|
||||
apt-mirror
|
||||
echo "[$(date)] Initial sync completed"
|
||||
|
||||
# Start cron in foreground to keep container running
|
||||
echo "[$(date)] Starting cron daemon for scheduled syncs"
|
||||
cron
|
||||
|
||||
echo "[$(date)] Starting nginx..."
|
||||
exec nginx -g "daemon off;"
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
set base_path /mirror
|
||||
set mirror_path $base_path/mirror
|
||||
set skel_path $base_path/skel
|
||||
set var_path $base_path/var
|
||||
set cleanscript $var_path/clean.sh
|
||||
set defaultarch amd64
|
||||
set postmirror_script $var_path/postmirror.sh
|
||||
set run_postmirror 0
|
||||
|
||||
deb http://deb.debian.org/debian/ trixie main contrib non-free non-free-firmware
|
||||
deb-src http://deb.debian.org/debian/ trixie main contrib non-free non-free-firmware
|
||||
|
||||
#deb http://security.debian.org/debian-security trixie-security main contrib non-free non-free-firmware
|
||||
#deb-src http://security.debian.org/debian-security trixie-security main contrib non-free non-free-firmware
|
||||
|
||||
deb http://deb.debian.org/debian/ trixie-updates main contrib non-free non-free-firmware
|
||||
deb-src http://deb.debian.org/debian/ trixie-updates main contrib non-free non-free-firmware
|
||||
|
||||
deb-amd64 https://download.docker.com/linux/debian trixie stable
|
||||
deb-all https://download.docker.com/linux/debian trixie stable
|
||||
|
||||
deb-amd64 https://pkgs.tailscale.com/stable/debian trixie main
|
||||
deb-all https://pkgs.tailscale.com/stable/debian trixie main
|
||||
|
||||
deb-amd64 https://nvidia.github.io/libnvidia-container/stable/deb/amd64/ /
|
||||
|
||||
deb http://download.proxmox.com/debian/pve trixie pve-no-subscription
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name _; # Responds to all hostnames
|
||||
|
||||
root /mirror;
|
||||
autoindex on; # Allows directory listing
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user