Add docker dev

This commit is contained in:
Jorit Tijsen
2024-05-06 13:32:23 +02:00
parent 6220a405a3
commit 684cba6085
6 changed files with 149 additions and 4 deletions

38
Dockerfile.dev Normal file
View File

@@ -0,0 +1,38 @@
FROM php:8.1-apache
RUN apt-get update \
&& apt-get -y install \
g++ \
libcurl4-gnutls-dev \
libxml2-dev \
libxslt-dev \
libzip-dev \
zlib1g-dev \
msmtp \
unzip \
git \
ssl-cert \
locales \
--no-install-recommends \
&& docker-php-ext-install pdo pdo_mysql mysqli xsl xml zip opcache \
&& a2enmod rewrite ssl proxy proxy_http headers \
&& apt-get purge -y g++ \
&& apt-get autoremove -y \
&& rm -r /var/lib/apt/lists/*
# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Update the default apache site with the config we created.
ADD docker/apache.dev.conf /etc/apache2/sites-enabled/000-default.conf
WORKDIR /var/www/html
COPY . /var/www/html
RUN mkdir -p storage/framework/{sessions,views,cache,cache/data} && \
chown -R www-data:www-data storage/framework && \
chmod -R 775 storage
# RUN php artisan cache:clear && \
# php artisan config:clear && \
# php artisan view:clear