-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
65 lines (54 loc) · 1.58 KB
/
Dockerfile
File metadata and controls
65 lines (54 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Multi-stage build for apt-mirror with nginx
FROM ubuntu:24.04 AS base
# Install system dependencies
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
nginx \
openssl \
curl \
wget \
nodejs \
npm \
xz-utils \
net-tools \
bzip2 \
gzip \
unzip \
ca-certificates \
tzdata \
bc \
gnupg \
jq \
&& rm -rf /var/lib/apt/lists/*
# Install skopeo for container image operations
RUN apt-get update && apt-get install -y \
skopeo \
&& rm -rf /var/lib/apt/lists/*
# Install apt-mirror from PyPI (using --break-system-packages for Ubuntu 24.04)
RUN pip3 install --break-system-packages apt-mirror uvloop
# Create necessary directories
RUN mkdir -p /var/spool/apt-mirror \
&& mkdir -p /var/www/mirror.intra \
&& mkdir -p /var/www/admin.mirror.intra \
&& mkdir -p /var/www/files \
&& mkdir -p /etc/nginx/sites-available \
&& mkdir -p /etc/nginx/sites-enabled \
&& mkdir -p /var/log/apt-mirror
COPY admin/ /var/admin
COPY admin/app/config/config.build.json /var/admin/app/config/config.json
RUN cd /var/admin && npm install && npm run build
# Copy scripts
COPY scripts/ /usr/local/bin/
RUN chmod +x /usr/local/bin/*.sh
# Create symlink for apt-mirror data
RUN ln -sf /var/spool/apt-mirror/mirror /var/www/mirror.intra/mirror
# Expose ports
EXPOSE 80 443
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost/ || exit 1
# Start script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]