-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
479 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
FROM dockette/debian:buster | ||
|
||
# PHP | ||
ENV PHP_MODS_DIR=/etc/php/7.2/mods-available | ||
ENV PHP_CLI_DIR=/etc/php/7.2/cli/ | ||
ENV PHP_CLI_CONF_DIR=${PHP_CLI_DIR}/conf.d | ||
ENV PHP_CGI_DIR=/etc/php/7.2/cgi/ | ||
ENV PHP_CGI_CONF_DIR=${PHP_CGI_DIR}/conf.d | ||
ENV PHP_FPM_DIR=/etc/php/7.2/fpm/ | ||
ENV PHP_FPM_CONF_DIR=${PHP_FPM_DIR}/conf.d | ||
ENV PHP_FPM_POOL_DIR=${PHP_FPM_DIR}/pool.d | ||
ENV PHP_FPM_BIN=/usr/sbin/php-fpm7.1 | ||
ENV PHP_FPM_CONF=/etc/php/7.1/php-fpm.conf | ||
ENV TZ=Europe/Prague | ||
|
||
# INSTALLATION | ||
RUN apt update && apt dist-upgrade -y && \ | ||
# DEPENDENCIES ############################################################# | ||
apt install -y wget curl apt-transport-https ca-certificates gnupg2 cron && \ | ||
# PHP DEB.SURY.CZ ########################################################## | ||
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \ | ||
echo "deb https://packages.sury.org/php/ buster main" > /etc/apt/sources.list.d/php.list && \ | ||
wget -O- http://nginx.org/keys/nginx_signing.key | apt-key add - && \ | ||
echo "deb http://nginx.org/packages/debian/ buster nginx" > /etc/apt/sources.list.d/nginx.list && \ | ||
echo "deb-src http://nginx.org/packages/debian/ buster nginx" >> /etc/apt/sources.list.d/nginx.list && \ | ||
apt update && \ | ||
apt install -y --no-install-recommends \ | ||
nginx \ | ||
supervisor \ | ||
php7.2-apc \ | ||
php7.2-apcu \ | ||
php7.2-bz2 \ | ||
php7.2-bcmath \ | ||
php7.2-calendar \ | ||
php7.2-cgi \ | ||
php7.2-cli \ | ||
php7.2-ctype \ | ||
php7.2-curl \ | ||
php7.2-fpm \ | ||
php7.2-geoip \ | ||
php7.2-gettext \ | ||
php7.2-gd \ | ||
php7.2-intl \ | ||
php7.2-imap \ | ||
php7.2-ldap \ | ||
php7.2-mbstring \ | ||
php7.2-memcached \ | ||
php7.2-mongo \ | ||
php7.2-mysql \ | ||
php7.2-pdo \ | ||
php7.2-pgsql \ | ||
php7.2-redis \ | ||
php7.2-soap \ | ||
php7.2-sqlite3 \ | ||
php7.2-ssh2 \ | ||
php7.2-tidy \ | ||
php7.2-zip \ | ||
php7.2-xmlrpc \ | ||
php7.2-xsl && \ | ||
# COMPOSER ################################################################# | ||
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --2 && \ | ||
# PHP MOD(s) ############################################################### | ||
rm ${PHP_FPM_POOL_DIR}/www.conf && \ | ||
# NGINX #################################################################### | ||
ln -sf /dev/stdout /var/log/nginx/access.log && \ | ||
ln -sf /dev/stderr /var/log/nginx/error.log && \ | ||
# CLEAN UP ################################################################# | ||
rm /etc/nginx/conf.d/default.conf && \ | ||
apt-get clean -y && \ | ||
apt-get autoclean -y && \ | ||
apt-get remove -y wget && \ | ||
apt-get autoremove -y && \ | ||
rm -rf /var/lib/apt/lists/* /var/lib/log/* /tmp/* /var/tmp/* | ||
|
||
# CRON | ||
RUN truncate -s 0 /etc/crontab | ||
|
||
# PHP | ||
ADD ./php/php-fpm.conf /etc/php/7.2/ | ||
ADD ./php/php.ini /etc/php/7.2/conf.d/ | ||
|
||
# NGINX | ||
ADD ./nginx/nginx.conf /etc/nginx/ | ||
ADD ./nginx/mime.types /etc/nginx/ | ||
ADD ./nginx/sites.d /etc/nginx/sites.d | ||
|
||
# WWW | ||
ADD ./www /srv/www/ | ||
|
||
# SUPERVISOR | ||
ADD ./supervisor/supervisord.conf /etc/supervisor/ | ||
ADD ./supervisor/services /etc/supervisor/conf.d/ | ||
|
||
# APPLICATION | ||
WORKDIR /srv | ||
|
||
EXPOSE 80 | ||
COPY entrypoint.sh /usr/sbin/entrypoint.sh | ||
RUN chmod +x /usr/sbin/entrypoint.sh | ||
CMD ["/usr/sbin/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
# loop through all the environment variables and append them to /etc/environment | ||
# because cron doesn't "see" docker environment variables | ||
echo -n > /etc/environment | ||
while IFS='=' read -r key value; do | ||
if [[ ! -z "$key" && ! -z "$value" ]]; then | ||
echo "$key=\"$value\"" >> /etc/environment | ||
fi | ||
done < <(printenv) | ||
|
||
# run supervisord | ||
supervisord --nodaemon --configuration /etc/supervisor/supervisord.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
types { | ||
|
||
# Data interchange | ||
|
||
application/atom+xml atom; | ||
application/json json map topojson; | ||
application/ld+json jsonld; | ||
application/rss+xml rss; | ||
application/vnd.geo+json geojson; | ||
application/xml rdf xml; | ||
|
||
|
||
# JavaScript | ||
|
||
# Normalize to standard type. | ||
# https://tools.ietf.org/html/rfc4329#section-7.2 | ||
application/javascript js; | ||
|
||
|
||
# Manifest files | ||
|
||
application/manifest+json webmanifest; | ||
application/x-web-app-manifest+json webapp; | ||
text/cache-manifest appcache; | ||
|
||
|
||
# Media files | ||
|
||
audio/midi mid midi kar; | ||
audio/mp4 aac f4a f4b m4a; | ||
audio/mpeg mp3; | ||
audio/ogg oga ogg opus; | ||
audio/x-realaudio ra; | ||
audio/x-wav wav; | ||
image/bmp bmp; | ||
image/gif gif; | ||
image/jpeg jpeg jpg; | ||
image/png png; | ||
image/svg+xml svg svgz; | ||
image/tiff tif tiff; | ||
image/vnd.wap.wbmp wbmp; | ||
image/webp webp; | ||
image/x-jng jng; | ||
video/3gpp 3gp 3gpp; | ||
video/mp4 f4p f4v m4v mp4; | ||
video/mpeg mpeg mpg; | ||
video/ogg ogv; | ||
video/quicktime mov; | ||
video/webm webm; | ||
video/x-flv flv; | ||
video/x-mng mng; | ||
video/x-ms-asf asf asx; | ||
video/x-ms-wmv wmv; | ||
video/x-msvideo avi; | ||
|
||
# Serving `.ico` image files with a different media type | ||
# prevents Internet Explorer from displaying then as images: | ||
# https://github.com/h5bp/html5-boilerplate/commit/37b5fec090d00f38de64b591bcddcb205aadf8ee | ||
|
||
image/x-icon cur ico; | ||
|
||
|
||
# Microsoft Office | ||
|
||
application/msword doc; | ||
application/vnd.ms-excel xls; | ||
application/vnd.ms-powerpoint ppt; | ||
application/vnd.openxmlformats-officedocument.wordprocessingml.document docx; | ||
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx; | ||
application/vnd.openxmlformats-officedocument.presentationml.presentation pptx; | ||
|
||
|
||
# Web fonts | ||
|
||
application/font-woff woff; | ||
application/font-woff2 woff2; | ||
application/vnd.ms-fontobject eot; | ||
|
||
# Browsers usually ignore the font media types and simply sniff | ||
# the bytes to figure out the font type. | ||
# https://mimesniff.spec.whatwg.org/#matching-a-font-type-pattern | ||
# | ||
# However, Blink and WebKit based browsers will show a warning | ||
# in the console if the following font types are served with any | ||
# other media types. | ||
|
||
application/x-font-ttf ttc ttf; | ||
font/opentype otf; | ||
|
||
|
||
# Other | ||
|
||
application/java-archive ear jar war; | ||
application/mac-binhex40 hqx; | ||
application/octet-stream bin deb dll dmg exe img iso msi msm msp safariextz; | ||
application/pdf pdf; | ||
application/postscript ai eps ps; | ||
application/rtf rtf; | ||
application/vnd.google-earth.kml+xml kml; | ||
application/vnd.google-earth.kmz kmz; | ||
application/vnd.wap.wmlc wmlc; | ||
application/x-7z-compressed 7z; | ||
application/x-bb-appworld bbaw; | ||
application/x-bittorrent torrent; | ||
application/x-chrome-extension crx; | ||
application/x-cocoa cco; | ||
application/x-java-archive-diff jardiff; | ||
application/x-java-jnlp-file jnlp; | ||
application/x-makeself run; | ||
application/x-opera-extension oex; | ||
application/x-perl pl pm; | ||
application/x-pilot pdb prc; | ||
application/x-rar-compressed rar; | ||
application/x-redhat-package-manager rpm; | ||
application/x-sea sea; | ||
application/x-shockwave-flash swf; | ||
application/x-stuffit sit; | ||
application/x-tcl tcl tk; | ||
application/x-x509-ca-cert crt der pem; | ||
application/x-xpinstall xpi; | ||
application/xhtml+xml xhtml; | ||
application/xslt+xml xsl; | ||
application/zip zip; | ||
text/css css; | ||
text/html htm html shtml; | ||
text/mathml mml; | ||
text/plain txt; | ||
text/vcard vcard vcf; | ||
text/vnd.rim.location.xloc xloc; | ||
text/vnd.sun.j2me.app-descriptor jad; | ||
text/vnd.wap.wml wml; | ||
text/vtt vtt; | ||
text/x-component htc; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
user www-data; | ||
worker_processes auto; | ||
worker_rlimit_nofile 8192; | ||
|
||
pid /var/run/nginx.pid; | ||
|
||
events { | ||
worker_connections 8000; | ||
} | ||
|
||
http { | ||
|
||
## | ||
# Basic Settings | ||
## | ||
|
||
sendfile on; | ||
tcp_nopush on; | ||
tcp_nodelay on; | ||
types_hash_max_size 2048; | ||
server_tokens off; | ||
|
||
client_max_body_size 128M; | ||
|
||
# server_names_hash_bucket_size 64; | ||
# server_name_in_redirect off; | ||
|
||
## | ||
# Charset | ||
## | ||
|
||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
charset_types text/css text/plain text/vnd.wap.wml application/javascript application/json application/rss+xml application/xml; | ||
|
||
## | ||
# Logging Settings | ||
## | ||
|
||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
access_log /var/log/nginx/access.log; | ||
error_log /var/log/nginx/error.log warn; | ||
|
||
## | ||
# Gzip Settings | ||
## | ||
|
||
gzip on; | ||
gzip_disable "msie6"; | ||
gzip_comp_level 5; | ||
gzip_min_length 256; | ||
gzip_proxied any; | ||
gzip_vary on; | ||
gzip_types | ||
application/atom+xml | ||
application/javascript | ||
application/json | ||
application/ld+json | ||
application/manifest+json | ||
application/rss+xml | ||
application/vnd.geo+json | ||
application/vnd.ms-fontobject | ||
application/x-font-ttf | ||
application/x-web-app-manifest+json | ||
application/xhtml+xml | ||
application/xml | ||
font/opentype | ||
image/bmp | ||
image/svg+xml | ||
image/x-icon | ||
text/cache-manifest | ||
text/css | ||
text/plain | ||
text/vcard | ||
text/vnd.rim.location.xloc | ||
text/vtt | ||
text/x-component | ||
text/x-cross-domain-policy; | ||
|
||
## | ||
# Virtual Host Configs | ||
## | ||
|
||
include /etc/nginx/conf.d/*.conf; | ||
include /etc/nginx/sites.d/*; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
## | ||
# Virtual Host Configs | ||
## | ||
upstream app { | ||
server unix:/var/run/php-fpm.sock; | ||
} | ||
|
||
server { | ||
listen 80; | ||
|
||
index index.html index.php; | ||
root /srv/www/; | ||
|
||
location / { | ||
try_files $uri $uri/ /index.php$is_args$args; | ||
} | ||
|
||
location ~* \.php$ { | ||
fastcgi_split_path_info ^(.+?\.php)(/.*)$; | ||
|
||
fastcgi_pass app; | ||
fastcgi_index index.php; | ||
include fastcgi_params; | ||
|
||
fastcgi_param PATH_INFO $fastcgi_path_info; | ||
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; | ||
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; | ||
fastcgi_param DOCUMENT_ROOT $realpath_root; | ||
|
||
try_files $uri =404; | ||
} | ||
} |
Oops, something went wrong.