Browse Source

Dockerfile update

master
filesite 3 years ago
parent
commit
b4f7bf38e6
  1. 26
      Dockerfile
  2. 35
      conf/nginx_default.conf
  3. 7
      docker-entrypoint.sh

26
Dockerfile

@ -1,26 +1,12 @@
FROM alpine FROM alpine
RUN mkdir -p /var/www/machete && \ RUN apk add php8-fpm nginx && \
mkdir -p /var/www/downloads && \ mkdir -p /var/www/downloads && cd /var/www/downloads/ && \
apk add gcc g++ make cmake pkgconf libxml2-dev sqlite-dev && \ wget "https://git.filesite.io/filesite/machete/archive/master.tar.gz" && \
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 && \
cd ../ && wget "https://git.filesite.io/filesite/machete/archive/master.tar.gz" && \
tar -zxvf master.tar.gz && \ tar -zxvf master.tar.gz && \
mv machete/* /var/www/machete/ && \ mv machete/ /var/www/ && \
cd /var/www/ && rm -rf downloads/ && \ cd /var/www/ && rm -rf downloads/ && \
cd /var/www/machete/ && \ rm -f /etc/nginx/http.d/default.conf && \
mkdir -p /usr/local/nginx/conf/conf.d && \ cp /var/www/machete/conf/nginx_machete.conf /etc/nginx/http.d/machete.conf
rm -f /usr/local/nginx/conf/nginx.conf && \
cp conf/nginx_default.conf /usr/local/nginx/conf/nginx.conf && \
cp conf/nginx_machete.conf /usr/local/nginx/conf/conf.d/machete.conf
EXPOSE 80/tcp EXPOSE 80/tcp
ENTRYPOINT ["/var/www/machete/docker-entrypoint.sh"] ENTRYPOINT ["/var/www/machete/docker-entrypoint.sh"]

35
conf/nginx_default.conf

@ -1,35 +0,0 @@
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
include /usr/local/nginx/conf/conf.d/*.conf;
}

7
docker-entrypoint.sh

@ -13,4 +13,9 @@ cp "template_${theme}.php" app.php
## 启动nginx和php-fpm ## 启动nginx和php-fpm
/usr/local/nginx/sbin/nginx if [ -e /usr/sbin/nginx ]; then
/usr/sbin/nginx
fi
if [ -e /usr/sbin/php-fpm8 ]; then
/usr/sbin/php-fpm8 -D
fi

Loading…
Cancel
Save