Created
June 23, 2021 09:13
-
-
Save rogervila/cb784cc7a661ab958203dc963048d219 to your computer and use it in GitHub Desktop.
Laravel Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.8" | |
services: | |
web: | |
build: | |
context: . | |
restart: always | |
ports: | |
- "8888:80" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:8.0-apache | |
WORKDIR /var/www | |
ENV DEBIAN_FRONTEND noninteractive | |
ENV APACHE_DOCUMENT_ROOT="/var/www/public" | |
RUN \ | |
apt-get update -y && \ | |
apt-get install -y --no-install-recommends curl git zip unzip libzip-dev && \ | |
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ | |
sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf && \ | |
sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf && \ | |
a2enmod rewrite && \ | |
docker-php-ext-install zip && \ | |
curl https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | |
ADD composer.json composer.json | |
ADD composer.lock composer.lock | |
RUN \ | |
composer install --no-dev --no-progress --no-scripts --no-autoloader --working-dir "/var/www/" | |
ADD . . | |
RUN \ | |
composer dump-autoload | |
EXPOSE 80 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment