From da5e3b538da42c9407dbda2ca3400f3ba17e966c Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Sun, 9 Jun 2024 20:42:39 -0400 Subject: [PATCH] Updates to docker build --- Dockerfile | 9 ++++++--- docker-compose.yml | 4 +++- install.sh | 6 ++++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6be4c33..be4caf8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2-apache +FROM php:8.3-apache RUN apt update && \ apt upgrade -y && \ @@ -45,10 +45,13 @@ RUN rm -rf /var/www/html/tests RUN rm -rf /var/www/html/translations 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/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 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 08c01cd..c033d2d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,4 +5,6 @@ services: container_name: sermon-notes image: ryanprather/sermon-notes:latest ports: - - 80:80 \ No newline at end of file + - 80:80 + volumes: + - ./data:/data \ No newline at end of file diff --git a/install.sh b/install.sh index c9263f1..f8ed7e9 100644 --- a/install.sh +++ b/install.sh @@ -10,8 +10,10 @@ LENGTH=32 SECRET_KEY=$(openssl rand -base64 $LENGTH | tr -d '=' | tr -d '+' | tr -d '/' | tr -d ' ') TRIMMED_KEY=$(cut -c1-32 <<< $SECRET_KEY) 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 -symfony console doctrine:migrations:migrate --no-interaction COMPOSER_ALLOW_SUPERUSER=1 composer update +symfony console doctrine:migrations:migrate --no-interaction + +chown -R www-data:www-data /data