Add Dockerfile and docker entrypoint (#5)

Add Dockerfile and docker entrypoint

Co-authored-by: lolcat <>
Reviewed-on: #5
Co-authored-by: throwaway <>
Co-committed-by: throwaway <>
throwaway 2023-08-23 18:31:08 -05:00 committed by throwaway
parent 9812155838
commit 40e058a32a
4 changed files with 135 additions and 0 deletions

Dockerfile 100644
View File

@ -0,0 +1,16 @@
FROM alpine:latest
WORKDIR /var/www/html/4get
RUN apk update && apk upgrade
RUN apk add apache2-ssl php82-fileinfo php82-openssl php82-iconv php82-common php82-dom php82-curl curl php82-pecl-apcu php82-apache2 imagemagick php82-pecl-imagick
COPY ./apache/httpd.conf /etc/apache2/httpd.conf
COPY . .
RUN chmod 777 /var/www/html/4get/icons
VOLUME ["/etc/4get/certs"]
CMD ["./docker/"]

View File

@ -102,3 +102,20 @@ service apache2 restart
You'll probably want to setup a tor address at this point, but I'm too lazy to put instructions here.
Ok bye!!!
## Docker Install
git clone
cd 4get
docker build -t 4get .
docker run -d -p 80:80 -p 443:443 -e FOURGET_SERVER_NAME="" -e FOURGET_SERVER_ADMIN_EMAIL="" -v /etc/letsencrypt/live/domain.tld:/etc/4get/certs 4get
replace enviroment variables FOURGET_SERVER_NAME and FOURGET_SERVER_ADMIN_EMAIL with relevant values
the certs directory expects files named `cert.pem`, `chain.pem`, `privkey.pem`

apache/httpd.conf 100644
View File

@ -0,0 +1,98 @@
ServerTokens OS
ServerRoot /var/www
ServerSignature On
DocumentRoot "/var/www/html/4get"
LogLevel warn
CustomLog /dev/null common
ErrorLog /dev/null
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/4get/certs/cert.pem
SSLCertificateKeyFile /etc/4get/certs/privkey.pem
SSLCertificateChainFile /etc/4get/certs/chain.pem
<Directory "/var/www/html/4get">
RewriteEngine On
RewriteCond %{THE_REQUEST} ^\w+\ /(.*)\.php(\?.*)?\ HTTP/
RewriteRule ^ http://%{HTTP_HOST}/%1 [R=301]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule .* $0.php
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
LoadModule rewrite_module modules/
LoadModule mpm_prefork_module modules/
LoadModule authn_file_module modules/
LoadModule authn_core_module modules/
LoadModule authz_host_module modules/
LoadModule authz_groupfile_module modules/
LoadModule authz_user_module modules/
LoadModule authz_core_module modules/
LoadModule access_compat_module modules/
LoadModule auth_basic_module modules/
LoadModule reqtimeout_module modules/
LoadModule filter_module modules/
LoadModule mime_module modules/
LoadModule log_config_module modules/
LoadModule env_module modules/
LoadModule headers_module modules/
LoadModule setenvif_module modules/
LoadModule version_module modules/
LoadModule unixd_module modules/
LoadModule status_module modules/
LoadModule autoindex_module modules/
LoadModule dir_module modules/
LoadModule alias_module modules/
LoadModule negotiation_module modules/
<IfModule unixd_module>
User apache
Group apache
<Directory />
AllowOverride none
Require all denied
<IfModule dir_module>
DirectoryIndex index.html
<Files ".ht*">
Require all denied
<IfModule headers_module>
RequestHeader unset Proxy early
<IfModule mime_module>
TypesConfig /etc/apache2/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
<IfModule mime_magic_module>
MIMEMagicFile /etc/apache2/magic
IncludeOptional /etc/apache2/conf.d/*.conf

View File

@ -0,0 +1,4 @@
sed -i "s/ServerName.*/ServerName ${FOURGET_SERVER_NAME}/g" /etc/apache2/httpd.conf
sed -i "s/ServerAdmin.*/ServerAdmin ${FOURGET_SERVER_ADMIN_EMAIL}/g" /etc/apache2/httpd.conf