mirror of
https://github.com/linuxserver/docker-baseimage-alpine-nginx.git
synced 2026-02-20 01:03:46 +08:00
53 lines
1.9 KiB
Docker
53 lines
1.9 KiB
Docker
FROM ghcr.io/linuxserver/baseimage-alpine:3.15
|
|
|
|
# install packages
|
|
RUN \
|
|
echo "**** install build packages ****" && \
|
|
apk add --no-cache \
|
|
apache2-utils \
|
|
git \
|
|
logrotate \
|
|
nano \
|
|
nginx \
|
|
openssl \
|
|
php8 \
|
|
php8-fileinfo \
|
|
php8-fpm \
|
|
php8-json \
|
|
php8-mbstring \
|
|
php8-openssl \
|
|
php8-session \
|
|
php8-simplexml \
|
|
php8-xml \
|
|
php8-xmlwriter \
|
|
php8-zlib && \
|
|
echo "**** configure nginx ****" && \
|
|
echo 'fastcgi_param HTTP_PROXY ""; # https://httpoxy.org/' >> \
|
|
/etc/nginx/fastcgi_params && \
|
|
echo 'fastcgi_param PATH_INFO $fastcgi_path_info; # http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_split_path_info' >> \
|
|
/etc/nginx/fastcgi_params && \
|
|
echo 'fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # https://www.nginx.com/resources/wiki/start/topics/examples/phpfcgi/#connecting-nginx-to-php-fpm' >> \
|
|
/etc/nginx/fastcgi_params && \
|
|
echo 'fastcgi_param SERVER_NAME $host; # Send HTTP_HOST as SERVER_NAME. If HTTP_HOST is blank, send the value of server_name from nginx (default is `_`)' >> \
|
|
/etc/nginx/fastcgi_params && \
|
|
rm -f /etc/nginx/http.d/default.conf && \
|
|
echo "**** configure php ****" && \
|
|
ln -s /usr/bin/php8 /usr/bin/php && \
|
|
sed -i "s#;error_log = log/php8/error.log.*#error_log = /config/log/php/error.log#g" \
|
|
/etc/php8/php-fpm.conf && \
|
|
sed -i "s#user = nobody.*#user = abc#g" \
|
|
/etc/php8/php-fpm.d/www.conf && \
|
|
sed -i "s#group = nobody.*#group = abc#g" \
|
|
/etc/php8/php-fpm.d/www.conf && \
|
|
echo "**** fix logrotate ****" && \
|
|
sed -i "s#/var/log/messages {}.*# #g" \
|
|
/etc/logrotate.conf && \
|
|
sed -i 's#/usr/sbin/logrotate /etc/logrotate.conf#/usr/sbin/logrotate /etc/logrotate.conf -s /config/log/logrotate.status#g' \
|
|
/etc/periodic/daily/logrotate
|
|
|
|
# add local files
|
|
COPY root/ /
|
|
|
|
# ports and volumes
|
|
EXPOSE 80 443
|