Dockerfile 929 B

12345678910111213141516171819202122232425262728293031
  1. FROM composer:2.4 as build
  2. FROM php:8.1-apache-buster as dev
  3. ENV APP_ENV=dev
  4. ENV APP_DEBUG=true
  5. ENV COMPOSER_ALLOW_SUPERUSER=1
  6. RUN apt-get update && apt-get install -y zip
  7. RUN apt-get install -y libpq-dev
  8. RUN apt install -y zlib1g-dev libpng-dev && rm -rf /var/lib/apt/lists/*
  9. RUN docker-php-ext-install pdo pdo_pgsql
  10. COPY . /var/www/html/
  11. RUN docker-php-ext-install gd
  12. COPY --from=build /usr/bin/composer /usr/bin/composer
  13. RUN composer update
  14. RUN composer install --prefer-dist --no-dev --optimize-autoloader --no-interaction
  15. COPY ./docker/apache/000-default.conf /etc/apache2/sites-available/000-default.conf
  16. COPY ./.env.docker /var/www/html/.env
  17. RUN php artisan config:clear && \
  18. php artisan route:clear && \
  19. php artisan cache:clear && \
  20. php artisan optimize && \
  21. chmod 777 -R /var/www/html/storage/ && \
  22. chown -R www-data:www-data /var/www/ && \
  23. a2enmod rewrite
  24. RUN service apache2 restart