Updates to docker build

This commit is contained in:
Ryan Prather 2024-06-09 20:42:39 -04:00
parent c2c08db342
commit da5e3b538d
3 changed files with 13 additions and 6 deletions

View File

@ -1,4 +1,4 @@
FROM php:8.2-apache FROM php:8.3-apache
RUN apt update && \ RUN apt update && \
apt upgrade -y && \ apt upgrade -y && \
@ -45,10 +45,13 @@ RUN rm -rf /var/www/html/tests
RUN rm -rf /var/www/html/translations RUN rm -rf /var/www/html/translations
RUN COMPOSER_ALLOW_SUPERUSER=1 composer install --no-scripts --no-dev --optimize-autoloader RUN COMPOSER_ALLOW_SUPERUSER=1 composer install --no-scripts --no-dev --optimize-autoloader
RUN mv /var/www/html/data/data.db /var/www/html/var/ RUN mkdir /data
RUN chown -R 33:33 /data
RUN chmod -R 755 /data
COPY data/data.db /data/data.db
RUN mkdir /var/www/html/var/cache RUN mkdir /var/www/html/var/cache
RUN mkdir /var/www/html/var/log RUN mkdir /var/www/html/var/log
RUN chown -R www-data:www-data /var/www/html RUN chown -R 33:33 /var/www/html
RUN chmod -R 755 /var/www/html RUN chmod -R 755 /var/www/html

View File

@ -6,3 +6,5 @@ services:
image: ryanprather/sermon-notes:latest image: ryanprather/sermon-notes:latest
ports: ports:
- 80:80 - 80:80
volumes:
- ./data:/data

View File

@ -10,8 +10,10 @@ LENGTH=32
SECRET_KEY=$(openssl rand -base64 $LENGTH | tr -d '=' | tr -d '+' | tr -d '/' | tr -d ' ') SECRET_KEY=$(openssl rand -base64 $LENGTH | tr -d '=' | tr -d '+' | tr -d '/' | tr -d ' ')
TRIMMED_KEY=$(cut -c1-32 <<< $SECRET_KEY) TRIMMED_KEY=$(cut -c1-32 <<< $SECRET_KEY)
echo "APP_SECRET=$TRIMMED_KEY" >> .env echo "APP_SECRET=$TRIMMED_KEY" >> .env
echo "DATABASE_URL=\"sqlite:///%kernel.project_dir%/var/data.db\"" >> .env echo "DATABASE_URL=\"sqlite:///data/data.db\"" >> .env
echo "MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0" >> .env echo "MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0" >> .env
symfony console doctrine:migrations:migrate --no-interaction
COMPOSER_ALLOW_SUPERUSER=1 composer update COMPOSER_ALLOW_SUPERUSER=1 composer update
symfony console doctrine:migrations:migrate --no-interaction
chown -R www-data:www-data /data