Initial commit (WIP)

This commit is contained in:
Quentin McGaw (desktop)
2021-07-29 17:44:30 -04:00
committed by Quentin McGaw (laptop)
parent ba676f7baf
commit 07716fe8b0
4 changed files with 250 additions and 0 deletions

28
docker/entrypoint.sh Normal file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
# TODO fail on any error
if [ "${DB_CONNECTION}" = "sqlite" ]; then
if [ ! -f /2fauth/.sqlite ]; then
touch /2fauth/.sqlite
fi
rm -f /srv/database/.sqlite
ln -sF /2fauth/.sqlite /srv/database/.sqlite
fi
sudo service php7.3-fpm start
sudo service php7.3-fpm status
if [ -f /2fauth/installed ]; then
php artisan migrate
php artisan config:clear
else
php artisan migrate:refresh
php artisan passport:install
php artisan storage:link
php artisan config:cache
echo "" > /2fauth/installed
fi
nginx
sudo service php7.3-fpm stop

38
docker/nginx.conf Normal file
View File

@@ -0,0 +1,38 @@
daemon off;
# user www-data www-data;
events {}
http {
include mime.types;
server {
listen 8000;
server_name 2fAuth;
root /srv/public;
# add_header X-Frame-Options "SAMEORIGIN";
# add_header X-Content-Type-Options "nosniff";
index index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
}