This commit is contained in:
Joey Kimsey
2024-12-02 19:05:04 -05:00
parent bf7b7ba1c9
commit 6f0b75cfd0
17 changed files with 888 additions and 108 deletions

11
docker/Dockerfile Normal file
View File

@ -0,0 +1,11 @@
FROM nginx:latest as nginx
FROM php:8-fpm as php-fpm
RUN apt-get update -y
RUN apt-get install -y libmariadb-dev
RUN docker-php-ext-install mysqli pdo pdo_mysql
FROM php:8-apache as apache
RUN a2enmod ssl && a2enmod rewrite
RUN docker-php-ext-install mysqli pdo pdo_mysql
WORKDIR /var/www/html

11
docker/apache.conf Normal file
View File

@ -0,0 +1,11 @@
ServerName localhost
<VirtualHost *:80>
ServerAdmin admin@localhost
DocumentRoot /var/www/html/
<Directory /var/www/html/>
DirectoryIndex index.php
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

66
docker/nginx.conf Normal file
View File

@ -0,0 +1,66 @@
server {
listen 80 default_server;
index index.php;
server_name TheTempusProject;
error_log /var/www/html/logs/nginx-error.log;
access_log /var/www/html/logs/nginx-access.log;
root /var/www/html;
charset utf-8;
sendfile off;
client_max_body_size 100m;
location /images/ {
if (!-e $request_filename){
rewrite ^/images/(.*)$ /index.php?error=image404&url=$1 last;
}
access_log off;
log_not_found off;
}
location /uploads/ {
if (!-e $request_filename){
rewrite ^/uploads/(.*)$ /index.php?error=upload404&url=$1 last;
}
access_log off;
log_not_found off;
}
location ~* \.(?:js|css|png|jpg|gif|ico)$ {
access_log off;
log_not_found off;
}
location = /favicon.ico {
access_log off;
log_not_found off;
rewrite ^(.+)$ /images/favicon.ico break;
}
location = /robots.txt {
allow all;
access_log off;
log_not_found off;
rewrite ^(.+)$ /bin/robots.txt break;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
fastcgi_connect_timeout 60s;
fastcgi_read_timeout 60s;
fastcgi_send_timeout 60s;
}
location / {
rewrite ^/errors/(.*)$ /index.php?error=$1 last;
rewrite ^(.+)$ /index.php?url=$1 last;
}
}