This repository was archived by the owner on Sep 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (50 loc) · 2.23 KB
/
Copy pathDockerfile
File metadata and controls
62 lines (50 loc) · 2.23 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
# 基础镜像
FROM alpine:3.16
ENV TZ=Asia/Shanghai
ENV PHP_DATE_TIMEZONE=Asia/Shanghai
# 使用国内镜像加速
#RUN sed -i 's#https\?://dl-cdn.alpinelinux.org/alpine#https://mirrors.tuna.tsinghua.edu.cn/alpine#g' /etc/apk/repositories
# 安装基础工具、nginx、php8及必要扩展
RUN apk add --no-cache \
bash curl \
tzdata nginx \
php8 php8-fpm php8-cli \
php8-curl php8-dom php8-fileinfo php8-gd php8-iconv \
php8-intl php8-mbstring php8-mysqli php8-openssl \
php8-pdo php8-pdo_mysql php8-pdo_sqlite php8-posix \
php8-simplexml php8-sockets php8-sodium php8-sqlite3 \
php8-xml php8-xmlreader php8-xmlwriter php8-opcache php8-session \
mariadb mariadb-client openjdk8 ; \
cp /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone; \
sed -i 's/;daemonize = yes/daemonize = no/' /etc/php8/php-fpm.conf; \
sed -i 's/^user = .*/user = nginx/' /etc/php8/php-fpm.d/www.conf; \
sed -i 's/^group = .*/group = nginx/' /etc/php8/php-fpm.d/www.conf; \
sed -i 's/;clear_env = no/clear_env = no/' /etc/php8/php-fpm.d/www.conf; \
sed -i 's/#gzip on;/gzip on;/' /etc/nginx/nginx.conf; \
sed -i 's/^#\(bind-address.*\)/\1/' /etc/my.cnf.d/mariadb-server.cnf; \
sed -i 's/^\(skip-networking.*\)/#\1/' /etc/my.cnf.d/mariadb-server.cnf; \
sed -i 's#/bin/ash#/bin/bash#g' /etc/passwd ; \
cp /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone; \
apk del tzdata ; \
rm -rf /usr/share/php8 /usr/lib/php8/tests /var/cache/apk/* /tmp/* ; \
mkdir -p /var/www/html
# 复制 nginx 默认站点配置
COPY docker/default.conf /etc/nginx/http.d/default.conf
# 复制WEB文件
COPY iptv /var/www/iptv
COPY database/iptv.sql /var/www/iptv.sql
COPY apktool/* /usr/bin/
COPY rename.sh /usr/bin/rename.sh
COPY rebuild.sh /usr/bin/rebuild.sh
COPY crontab_downlist.sh /usr/bin/crontab_downlist.sh
COPY client /client
COPY docker/docker-entrypoint.sh /usr/bin/docker-entrypoint.sh
RUN chmod +x /usr/bin/docker-entrypoint.sh && \
chmod +x /usr/bin/apktool* && \
chmod +x /usr/bin/rename.sh && \
chmod +x /usr/bin/rebuild.sh && \
chmod +x /usr/bin/crontab_downlist.sh
# 暴露端口
EXPOSE 80
# 启动 supervisord 管理 nginx + php-fpm
ENTRYPOINT ["docker-entrypoint.sh"]