From 8305324206d05ff6ffaa1318c8ae732c3c96ce88 Mon Sep 17 00:00:00 2001 From: filesite Date: Mon, 23 May 2022 21:24:17 +0800 Subject: [PATCH] add Dockerfile --- Dockerfile | 19 +++++++++++++++++++ docker-entrypoint.sh | 20 ++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 Dockerfile create mode 100755 docker-entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..60fe68d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM alpine +RUN mkdir -p /var/www/machete && \ + mkdir -p /var/www/downloads && \ + apk add gcc g++ make cmake pkgconf libxml2-dev sqlite-dev && \ + cd /var/www/downloads && \ + wget "https://nginx.org/download/nginx-1.21.6.tar.gz" && \ + wget "https://www.php.net/distributions/php-8.1.6.tar.gz" && \ + tar -zxvf nginx-1.21.6.tar.gz && \ + tar -zxvf php-8.1.6.tar.gz && \ + cd nginx-1.21.6/ && \ + ./configure --without-http_rewrite_module --without-http_gzip_module && \ + make && make install && \ + cd ../php-8.1.6/ && \ + ./configure --enable-fpm && make && make install +##TODO: 下载最新源码,并配置好nginx完成部署 + +ENTRYPOINT ["/var/www/machete/docker-entrypoint.sh"] +## 默认使用导航站皮肤:webdirectory +CMD ["webdirectory"] diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100755 index 0000000..03bc66b --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,20 @@ +#!/bin/sh +themes=( +manual +googleimage +webdirectory +) + +theme=$1 +if [ ! -z "${theme}" ]; then + if [[ ! "${themes[@]}" =~ "${theme}" ]]; then + theme=webdirectory + fi +else + theme=webdirectory +fi + +echo "Theme chosed [${theme}]." + +##TODO: 复制对应皮肤的配置文件到docker容器指定目录 +