chore: add docker local development files

This commit is contained in:
2024-02-27 12:06:38 +01:00
parent dbf77d437c
commit c1ef2d7070
9 changed files with 105 additions and 1 deletions

38
Dockerfile 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.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

View File

@@ -105,7 +105,7 @@ return [
'key' => env('APP_KEY'),
'cipher' => 'AES-256-CBC',
'cipher' => 'aes-256-cbc',
/*
|--------------------------------------------------------------------------

10
docker-compose.yml Normal file
View File

@@ -0,0 +1,10 @@
version: '3.8'
services:
web:
build: ./
ports:
- 8080:80
- 8443:443
volumes:
- .:/var/www/html

46
docker/apache.conf Normal file
View File

@@ -0,0 +1,46 @@
Header set X-Content-Type-Options: "nosniff"
Header set X-Frame-Options: "sameorigin"
ServerTokens Prod
<VirtualHost *:80>
ServerName localhost
ServerAdmin support@websight.nl
DocumentRoot /var/www/html/public
<Directory /var/www/html/public/>
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All
Order deny,allow
Allow from all
</Directory>
ErrorLog /var/log/apache2/vhost-error.log
CustomLog /var/log/apache2/vhost-access.log combined
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName localhost
ServerAdmin support@websight.nl
DocumentRoot /var/www/html/public
SSLEngine on
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
SSLCompression off
SSLProtocol All -SSLv2 -SSLv3
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
<Directory /var/www/html/public/>
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All
Order deny,allow
Allow from all
</Directory>
ErrorLog /var/log/apache2/ssl-vhost-error.log
CustomLog /var/log/apache2/ssl-vhost-access.log combined
</VirtualHost>
</IfModule>

2
storage/app/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*
!.gitignore

View File

@@ -0,0 +1,2 @@
*
!.gitignore

2
storage/framework/sessions/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*
!.gitignore

2
storage/framework/views/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*
!.gitignore

2
storage/logs/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*
!.gitignore