From 2c2381a0f1f11a6ce884a7ddd5ac0ee57af21bb2 Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Thu, 23 May 2024 17:43:46 -0400 Subject: [PATCH] Update docker build file --- Dockerfile | 15 +++++++++------ install.sh | 4 ++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index ddba4d6..11a8795 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,9 @@ FROM php:8.2-apache WORKDIR /var/www/html -RUN apt-get update && \ - apt-get install -y \ +RUN apt update && \ + apt upgrade -y && \ + apt install -y \ libzip-dev \ unzip \ libonig-dev \ @@ -38,12 +39,14 @@ RUN curl -sS https://get.symfony.com/cli/installer | bash && \ COPY 000-default.conf /etc/apache2/sites-available/ -COPY composer.lock composer.json ./ +COPY composer.lock composer.json /var/www/html/ RUN composer install --no-scripts --no-dev --optimize-autoloader -COPY . . +COPY . /var/www/html/ +RUN rm /var/www/html/.env* -EXPOSE 80 +RUN cp /var/www/html/data/data.db /var/www/html/var/ -CMD ["apache2-foreground"] +RUN chown -R www-data:www-data /var/www/html +RUN chmod -R 755 /var/www/html \ No newline at end of file diff --git a/install.sh b/install.sh index 4d40ec7..4185e00 100644 --- a/install.sh +++ b/install.sh @@ -5,3 +5,7 @@ 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.local +echo "APP_ENV=prod" >> .env.local +echo "APP_DEBUG=0" >> .env.local +echo "DATABASE_URL=\"sqlite:///%kernel.project_dir%/var/data.db\"" >> .env.local +echo "MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0" >> .env.local