commit 92d655743b030a1c315cd8588cdcd97dd90dcc9e Author: aptalca Date: Tue Feb 6 20:12:08 2018 -0500 Initial commit diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..cdb1a82 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +.git +.gitignore +.github +.gitattributes +READMETEMPLATE.md +README.md diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..bdb0cab --- /dev/null +++ b/.gitattributes @@ -0,0 +1,17 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..c73c33b --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,21 @@ + + +[linuxserverurl]: https://linuxserver.io +[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] + + + + + + + + + + + + + + + +## Thanks, team linuxserver.io + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..f6a6381 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,15 @@ + + +[linuxserverurl]: https://linuxserver.io +[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] + + + + + + + + + +## Thanks, team linuxserver.io + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..96374c4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,43 @@ +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# ========================= +# Operating System Files +# ========================= + +# OSX +# ========================= + +.DS_Store +.AppleDouble +.LSOverride + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c9f532e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +FROM lsiobase/alpine.nginx:3.7 + +# set version label +ARG BUILD_DATE +ARG VERSION +LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" +LABEL maintainer="aptalca" + +# environment settings +ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2 + +# install packages +RUN \ + apk add --no-cache \ + curl \ + php7-ctype \ + php7-pdo_sqlite \ + php7-tokenizer \ + tar && \ + mkdir -p /app/heimdall && \ + VERSION="$(curl -sX GET https://api.github.com/repos/linuxserver/Heimdall/releases/latest | grep 'tag_name' | cut -d\" -f4)" && \ + echo "**Installing Heimdall ${VERSION}**" && \ + curl -o \ + /tmp/heimdall.tar.gz -L \ + "https://github.com/linuxserver/Heimdall/archive/${VERSION}.tar.gz" && \ + tar xf \ + /tmp/heimdall.tar.gz -C \ + /tmp && \ + cp -R /tmp/Heimdall-*/* /app/heimdall/ && \ + echo "** cleanup **" && \ + rm -rf \ + /tmp/* + +# add local files +COPY root/ / diff --git a/README.md b/README.md new file mode 100644 index 0000000..4ccf51c --- /dev/null +++ b/README.md @@ -0,0 +1,98 @@ +[linuxserverurl]: https://linuxserver.io +[forumurl]: https://forum.linuxserver.io +[ircurl]: https://www.linuxserver.io/irc/ +[podcasturl]: https://www.linuxserver.io/podcast/ +[appurl]: https://nginx.org/ +[hub]: https://hub.docker.com/r/linuxserver/nginx/ + +[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] + +The [LinuxServer.io][linuxserverurl] team brings you another container release featuring easy user mapping and community support. Find us for support at: +* [forum.linuxserver.io][forumurl] +* [IRC][ircurl] on freenode at `#linuxserver.io` +* [Podcast][podcasturl] covers everything to do with getting the most from your Linux Server plus a focus on all things Docker and containerisation! + +# linuxserver/nginx +[![](https://images.microbadger.com/badges/version/linuxserver/nginx.svg)](https://microbadger.com/images/linuxserver/nginx "Get your own version badge on microbadger.com")[![](https://images.microbadger.com/badges/image/linuxserver/nginx.svg)](https://microbadger.com/images/linuxserver/nginx "Get your own image badge on microbadger.com")[![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/nginx.svg)][hub][![Docker Stars](https://img.shields.io/docker/stars/linuxserver/nginx.svg)][hub][![Build Status](https://ci.linuxserver.io/buildStatus/icon?job=Docker-Builders/x86-64/x86-64-nginx)](https://ci.linuxserver.io/job/Docker-Builders/job/x86-64/job/x86-64-nginx/) + +This Container is a simple nginx webserver configured with default and ssl, and all relevant config files moved out the user via /config for ultimate control. it contains some of the basic php-packages. and is built on our internal nginx baseimage. + +[![nginx](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/nginx-banner.png)][appurl] + +## Usage + +``` +docker create \ +--name=nginx \ +-v :/config \ +-e PGID= -e PUID= \ +-p 80:80 -p 443:443 \ +-e TZ= \ +linuxserver/nginx +``` + +## Parameters + +`The parameters are split into two halves, separated by a colon, the left hand side representing the host and the right the container side. +For example with a port -p external:internal - what this shows is the port mapping from internal to external of the container. +So -p 8080:80 would expose port 80 from inside the container to be accessible from the host's IP on port 8080 +http://192.168.x.x:8080 would show you what's running INSIDE the container on port 80.` + + +* `-p 80` - The web-services. +* `-p 443` - The SSL-Based Webservice +* `-v /config` - Contains your www content and all relevant configuration files. +* `-e PGID` for GroupID - see below for explanation +* `-e PUID` for UserID - see below for explanation +* `-e TZ` - timezone ie. `America/New_York` + +It is based on alpine linux with s6 overlay, for shell access whilst the container is running do `docker exec -it nginx /bin/bash`. + +### User / Group Identifiers + +Sometimes when using data volumes (`-v` flags) permissions issues can arise between the host OS and the container. We avoid this issue by allowing you to specify the user `PUID` and group `PGID`. Ensure the data volume directory on the host is owned by the same user you specify and it will "just work" ™. + +In this instance `PUID=1001` and `PGID=1001`. To find yours use `id user` as below: + +``` + $ id + uid=1001(dockeruser) gid=1001(dockergroup) groups=1001(dockergroup) +``` + +## Setting up the application + +Add your web files to /config/www for hosting. + +*Protip: This container is best combined with a sql server, e.g. [mariadb](https://hub.docker.com/r/linuxserver/mariadb/)* + + +## Info + +* To monitor the logs of the container in realtime `docker logs -f nginx`. + + +* container version number + +`docker inspect -f '{{ index .Config.Labels "build_version" }}' nginx` + +* image version number + +`docker inspect -f '{{ index .Config.Labels "build_version" }}' linuxserver/nginx` + +## Versions + ++ **05.01.18:** Rebase to alpine 3.7 ++ **08.11.17:** Add php7 soap module ++ **31.10.17:** Add php7 exif and xmlreader modules ++ **30.09.17:** Copy additional root files into image ++ **24.09.17:** Add memcached service ++ **31.08.17:** Add php7-phar ++ **14.07.17:** Enable modules dynamically in nginx.conf ++ **22.06.17:** Add various nginx modules and enable all modules in the default nginx.conf ++ **05.06.17:** Add php7-bz2 ++ **25.05.17:** Rebase to alpine 3.6. ++ **18.04.17:** Add php7-sockets ++ **27.02.17:** Rebase to alpine 3.5, update to nginx 1.10.2 and php7 ++ **14.10.16:** Add version layer information. ++ **10.09.16:** Add badges to README. ++ **05.12.15:** Intial Release. diff --git a/root/defaults/default b/root/defaults/default new file mode 100644 index 0000000..3ed4712 --- /dev/null +++ b/root/defaults/default @@ -0,0 +1,30 @@ +server { + listen 80 default_server; + + listen 443 ssl; + + root /app/root; + index index.php index.html index.htm; + + server_name _; + + ssl_certificate /config/keys/cert.crt; + ssl_certificate_key /config/keys/cert.key; + + client_max_body_size 0; + + location / { + try_files $uri $uri/ /index.php?$args =404; + } + + location ~ \.php$ { + fastcgi_split_path_info ^(.+\.php)(/.+)$; + # With php5-cgi alone: + fastcgi_pass 127.0.0.1:9000; + # With php5-fpm: + #fastcgi_pass unix:/var/run/php5-fpm.sock; + fastcgi_index index.php; + include /etc/nginx/fastcgi_params; + + } +} diff --git a/root/defaults/nginx.conf b/root/defaults/nginx.conf new file mode 100644 index 0000000..70e8488 --- /dev/null +++ b/root/defaults/nginx.conf @@ -0,0 +1,98 @@ +user abc; +worker_processes 4; +pid /run/nginx.pid; +include /etc/nginx/modules/*.conf; + +events { + worker_connections 768; + # multi_accept on; +} + +http { + + ## + # Basic Settings + ## + + sendfile on; + tcp_nopush on; + tcp_nodelay on; + keepalive_timeout 65; + types_hash_max_size 2048; + # server_tokens off; + + # server_names_hash_bucket_size 64; + # server_name_in_redirect off; + + client_max_body_size 0; + + include /etc/nginx/mime.types; + default_type application/octet-stream; + + ## + # Logging Settings + ## + + access_log /config/log/nginx/access.log; + error_log /config/log/nginx/error.log; + + ## + # Gzip Settings + ## + + gzip on; + gzip_disable "msie6"; + + # gzip_vary on; + # gzip_proxied any; + # gzip_comp_level 6; + # gzip_buffers 16 8k; + # gzip_http_version 1.1; + # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; + + ## + # nginx-naxsi config + ## + # Uncomment it if you installed nginx-naxsi + ## + + #include /etc/nginx/naxsi_core.rules; + + ## + # nginx-passenger config + ## + # Uncomment it if you installed nginx-passenger + ## + + #passenger_root /usr; + #passenger_ruby /usr/bin/ruby; + + ## + # Virtual Host Configs + ## + include /etc/nginx/conf.d/*.conf; + include /config/nginx/site-confs/*; +} + + +#mail { +# # See sample authentication script at: +# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript +# +# # auth_http localhost/auth.php; +# # pop3_capabilities "TOP" "USER"; +# # imap_capabilities "IMAP4rev1" "UIDPLUS"; +# +# server { +# listen localhost:110; +# protocol pop3; +# proxy on; +# } +# +# server { +# listen localhost:143; +# protocol imap; +# proxy on; +# } +#} +daemon off; diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config new file mode 100644 index 0000000..b288fe0 --- /dev/null +++ b/root/etc/cont-init.d/50-config @@ -0,0 +1,30 @@ +#!/usr/bin/with-contenv bash + +# create folders +mkdir -p \ + /config/www/{backgrounds,icons} + +# set base url if needed +rm -rf /app/root +if [ -z "$BASEURL" ]; then + echo "No base url set. You can access the app at http://SERVERIP:PORT" + ln -s ./heimdall/public /app/root +else + echo "Setting base url. You can access the app at http://SERVERIP:PORT/$BASEURL" + mkdir -p /app/root + ln -s ../heimdall/public /app/root/"$BASEURL" +fi + +# symlink user config +rm -rf \ + /app/heimdall/storage/app/public/backgrounds \ + /app/heimdall/storage/app/public/icons \ + /app/heimdall/database/app.sqlite +ln -s /config/www/backgrounds /app/heimdall/storage/app/public/backgrounds +ln -s /config/www/icons /app/heimdall/storage/app/public/icons +ln -s /config/www/app.sqlite /app/heimdall/database/app.sqlite + +# permissions +chown -R abc:abc \ + /config \ + /app