Update docker build file

This commit is contained in:
Ryan Prather 2024-05-23 17:43:46 -04:00
parent 591f80c288
commit 2c2381a0f1
2 changed files with 13 additions and 6 deletions

View File

@ -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

View File

@ -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