Update script with php/web container differences

This commit is contained in:
zeke 2024-02-04 23:34:17 -08:00
parent 64ba328c3b
commit 57a6154287
3 changed files with 19 additions and 10 deletions

View File

@ -1,10 +1,12 @@
#!/bin/sh
# not exactly elegant, but one container is Debian, the other is Alpine
if [ "$1" == "php" ]; then
useradd -MU leftypol
else
addgroup leftypol
adduser -DHG leftypol leftypol
fi
set -eu
install -m 775 -o leftypol -g leftypol -d /var/www-leftypol
@ -21,8 +23,8 @@ ln -s \
/code/install.sql \
/var/www-leftypol/
install -m 775 -o leftypol -g leftypol -d /var/www/js
ln -s /code/js/* /var/www/js/
install -m 775 -o leftypol -g leftypol -d /var/www-leftypol/js
ln -s /code/js/* /var/www-leftypol/js/
install -m 775 -o leftypol -g leftypol -d /var/www-leftypol/templates
install -m 775 -o leftypol -g leftypol -d /var/www-leftypol/templates/cache
@ -30,3 +32,9 @@ ln -s /code/templates/* /var/www-leftypol/templates/
install -m 775 -o leftypol -g leftypol -d /var/www-leftypol/inc
ln -s /code/inc/* /var/www-leftypol/inc/
if [ "$1" = "php" ]; then
ln -s /code/composer.json /code/composer.lock /var/www-leftypol/ \
cd /var/www
composer install
fi

View File

@ -1,7 +1,7 @@
FROM nginx:1.25.3-alpine
COPY . /code
RUN /code/docker/common-setup.sh
RUN /code/docker/common-setup.sh web
CMD ["nginx", "-g", "daemon off;"]

View File

@ -35,10 +35,11 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y \
&& pecl install imagick \
&& pecl install -o -f igbinary \
&& docker-php-ext-install gd zip opcache intl pdo pdo_mysql mysqli bcmath gettext iconv mbstring curl \
&& docker-php-ext-enable igbinary redis imagick
&& docker-php-ext-enable igbinary redis imagick \
&& /code/docker/common-setup.sh \
&& cd /var/www-leftypol && composer install
RUN /code/docker/common-setup.sh
# RUN /code/docker/common-setup.sh php
WORKDIR "/var/www-leftypol"
CMD ["php-fpm"]
EXPOSE 9000