From f83830443b4906d13ca56877303732a64979e21b Mon Sep 17 00:00:00 2001 From: Lee Date: Fri, 7 Jul 2023 23:04:51 +0000 Subject: [PATCH] revert d89ed9e17df3b995c9c4ed185afb0a1a7c2a6d12 revert alpine tests --- Dockerfile | 12 +++++++----- docker/start.sh | 21 ++++++++++----------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 676e357..b4beec2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,12 @@ -FROM alpine:3.14 +FROM ubuntu:23.04 # Install dependencies -RUN apk update && \ - apk upgrade && \ - apk add --no-cache nginx php8.1 php8.1-fpm php8.1-gd php8.1-imagick && \ - rm -rf /var/cache/apk/* +RUN apt update +RUN DEBIAN_FRONTEND=noninteractive \ +apt install nginx php8.1 php8.1-fpm php8.1-gd php8.1-imagick -y + +# Clean up +RUN apt clean # Set up nginx COPY ./docker/nginx.conf /etc/nginx/nginx.conf diff --git a/docker/start.sh b/docker/start.sh index adc3992..9751857 100644 --- a/docker/start.sh +++ b/docker/start.sh @@ -1,20 +1,18 @@ -#!/bin/sh - -if [ -z "$MAX_UPLOAD_SIZE" ]; then +if [[ -z "${MAX_UPLOAD_SIZE}" ]]; then MAX_UPLOAD_SIZE="8M" # Default fallback value fi echo "Checking if upload script exists in /var/www/html" if [ -f "/var/www/html/upload.php" ]; then - echo "Upload script was found, ignoring copy." + echo "Upload script was found, ignoring copy." else - cp /tmp/upload.php /var/www/html - echo "Upload script was not found, copying it." + cp /tmp/upload.php /var/www/html + echo "Upload script was not found, copying it." fi # Letting php know that we are running in docker -echo "env[DOCKER] = true" >> /etc/php8/php-fpm.d/www.conf -echo "clear_env = no" >> /etc/php8/php-fpm.d/www.conf +echo "env[DOCKER] = true" >> /etc/php/8.1/fpm/pool.d/www.conf +echo "clear_env = no" >> /etc/php/8.1/fpm/pool.d/www.conf echo "Setting permissions for upload script" chmod 777 /var/www/html/upload.php @@ -22,15 +20,16 @@ chmod 777 /var/www/html/upload.php echo "Setting max upload size to ${MAX_UPLOAD_SIZE}" # Set max upload size for php -sed -i "s/^upload_max_filesize = .*/upload_max_filesize = ${MAX_UPLOAD_SIZE}/" /etc/php8/php.ini -sed -i "s/^post_max_size = .*/post_max_size = ${MAX_UPLOAD_SIZE}/" /etc/php8/php.ini +sed -i "s/^upload_max_filesize = .*/upload_max_filesize = ${MAX_UPLOAD_SIZE}/" /etc/php/8.1/fpm/php.ini +sed -i "s/^post_max_size = .*/post_max_size = ${MAX_UPLOAD_SIZE}/" /etc/php/8.1/fpm/php.ini # Set max upload size for nginx sed -i "s/client_max_body_size 500M;/client_max_body_size ${MAX_UPLOAD_SIZE};/" /etc/nginx/nginx.conf function start() { echo "Starting PHP & Nginx" - php-fpm8 && + /etc/init.d/php8.1-fpm start && + chmod 777 /run/php/php8.1-fpm.sock && nginx -g 'daemon off;' }