Giter Site home page Giter Site logo

docker's Introduction

Description This repository contains a collection of Docker configurations I've put together to meet my needs.

Directory Structure All frameworks have a simple directory structure that can be used to easily deploy web applications. Try it for yourself. See below for an example (all applications & services follow this basic structure).

/app - application directory (web root, etc), not modified at runtime
    index.html - example application
/config - configuration directory, not modified at runtime
    /init - init file directory, not modified at runtime
        application - executed at startup of application
    fastcgi-*.conf - included by nginx
    nginx-*.conf - included by nginx
    php-*.conf - included by php-fpm
/data - data directory, modified at runtime (can be a volume)
    /logs
        nginx.log # nginx log file
        php-fpm.log # php-fpm log file

Usage The following commands can be used to deploy some of the services offered by the Docker containers in this repository.

  • Applications

    • Adminer

        docker run --name="adminer" -d -e "VIRTUAL_HOST=adminer.example.com" --link mariadb:mariadb --link postgresql:postgresql maxexcloo/adminer
      
    • phpMyAdmin

        docker run --name="phpmyadmin" -d -e "VIRTUAL_HOST=phpmyadmin.example.com" --link mariadb:mariadb maxexcloo/phpmyadmin
      
    • Tiny Tiny RSS

        docker volume create --name="tiny-tiny-rss"
        docker run --name="tiny-tiny-rss" -it -e "VIRTUAL_HOST=tiny-tiny-rss.example.com" --link postgresql:postgresql -v tiny-tiny-rss:/data maxexcloo/tiny-tiny-rss
      
    • Wordpress

        docker volume create --name="wordpress"
        docker run --name="wordpress" -it -e "VIRTUAL_HOST=wordpress.example.com" --link mariadb:mariadb -v wordpress:/data maxexcloo/wordpress
      
  • Base

    • Debian

        docker run --name="debian" -it maxexcloo/debian bash
      
    • Ubuntu

        docker run --name="ubuntu" -it maxexcloo/ubuntu bash
      
  • Frameworks

    • EasyEngine

        docker run --name="easyengine" -it -p 80:80 -p 443:443 maxexcloo/easyengine
        docker exec -it easyengine bash
      
    • Java

        docker run --name="java" -it maxexcloo/java bash
      
    • nginx

        docker volume create --name="nginx"
        docker volume create --name="nginx-data"
        docker run --name="nginx" -it -e "VIRTUAL_HOST=example.com,www.example.com" -v nginx:/app -v nginx-data:/data maxexcloo/nginx
      
    • nginx + PHP-FPM

        docker volume create --name="nginx-php"
        docker volume create --name="nginx-php-data"
        docker run --name="nginx-php" -it -e "VIRTUAL_HOST=example.com,www.example.com" -v nginx-php:/app -v nginx-php-data:/data maxexcloo/nginx-php
      
    • nginx + Phusion Passenger

        docker volume create --name="nginx-passenger"
        docker volume create --name="nginx-passenger-data"
        docker run --name="nginx-passenger" -it -e "VIRTUAL_HOST=example.com,www.example.com" -v nginx-passenger:/app -v nginx-passenger-data:/data maxexcloo/nginx-passenger
      
    • Node.js

        docker run --name="node" -it maxexcloo/node bash
      
  • Services

    • Certbot

        docker run --name="certbot" -it -e "[email protected]"-v docker-gen:/data maxexcloo/certbot
      
    • CouchPotato

        docker volume create --name="couchpotato"
        docker run --name="couchpotato" -it -e "VIRTUAL_HOST=couchpotato.example.com" -e "VIRTUAL_PORT=5050" -v couchpotato:/data maxexcloo/couchpotato
      
    • Directory Listing

        docker volume create --name="directory-listing"
        docker run --name="directory-listing" -it -v directory-listing:/data maxexcloo/directory-listing
      
    • Docker Gen

        docker volume create --name="docker-gen"
        docker run --name="docker-gen" -it -v /var/run/docker.sock:/var/run/docker.sock -v docker-gen:/data maxexcloo/haproxy-config
      
    • HAProxy

        docker run --name="haproxy" -it -p 80:80 -p 43:443 -v docker-gen:/data maxexcloo/haproxy
      
    • MariaDB

        docker volume create --name="mariadb"
        docker run --name="mariadb" -it -e "MARIADB_USER=docker" -e "MARIADB_PASS=docker" -v mariadb:/data maxexcloo/mariadb
      
    • Minecraft

        docker volume create --name="minecraft"
        docker run --name="minecraft" -it -e "MEMORY=1024" -p 25565:25565 -v minecraft:/data maxexcloo/minecraft
      
    • OpenSSH

        docker run --name="openssh" -it -p 22:22 maxexcloo/openssh
      
    • OpenVPN

        docker volume create --name="openvpn"
        docker run --name="openvpn" -it -p 443:443 -p 1194:1194/udp -v openvpn:/data maxexcloo/openvpn
        docker run --name="openvpn" -it -e "VIRTUAL_HOST=openvpn.example.com" --rm maxexcloo/openvpn -v openvpn:/data /app/host
      
    • Plex Media Server

        docker volume create --name="plexmediaserver"
        docker run --name="plexmediaserver" -it -e "VIRTUAL_HOST=plexmediaserver.example.com" -e "VIRTUAL_PORT=32400" -p 32400:32400 -v plexmediaserver:/data maxexcloo/plexmediaserver
      
    • PostgreSQL

        docker volume create --name="postgresql"
        docker run --name="postgresql" -it -v postgresql:/data maxexcloo/postgresql
      
    • ReadyMedia

        docker volume create --name="readymedia"
        docker run --name="readymedia" -it -p 1900:1900/udp -p 8200:8200 -v readymedia:/data maxexcloo/readymedia
      
    • SABnzbd

        docker volume create --name="sabnzbd"
        docker run --name="sabnzbd" -it -e "VIRTUAL_HOST=sabnzbd.example.com" -e "VIRTUAL_PORT=8080" -v sabnzbd:/data maxexcloo/sabnzbd
      
    • SickBeard

        docker volume create --name="sickbeard"
        docker run --name="sickbeard" -it -e "VIRTUAL_HOST=sickbeard.example.com" -e "VIRTUAL_PORT=8081" -v sickbeard:/data maxexcloo/sickbeard
      
    • ZNC

        docker volume create --name="znc"
        docker run --name="znc" -it -e "VIRTUAL_HOST=znc.example.com" -e "VIRTUAL_PORT=6667" -p 6667:6667 -v znc:/data maxexcloo/znc
      

docker's People

Contributors

airtonix avatar ambroisemaupate avatar anton-ryzhov avatar ifdattic avatar joshstrange avatar maxexcloo avatar mdoukmak avatar scmx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker's Issues

php-fpm.sock Operation permitted

Hi!

There is a problem using your image maxexcloo/nginx-php on Mac and mount the /data volume to the host system.
The php-fpm process quits with status code 78, cause it is not able to create the sock-file. I guess, cause of the host-file system.
I tryed to resolve the problem but the only way was to put the php-fpm.sock in another folder like /run. So, I decided to make an own Dockerfile based on your image and use updated conf-files. Maybe you had a good reason to put the sock-file inside the /data volume, but I have no clue why. If you like I can give you my working changes!?

Regards

Add envvars to PHP-FPM configuration files

It will be nice to add for php-nginx docker:

# Add envvars to PHP-FPM configuration files
envs=`printenv`

for env in $envs
do
    IFS== read name value <<< "$env"
    echo "env[$name] = $value" >> /etc/php5/fpm/php-fpm.conf
done

Certificates for CouchPotato

Can you pls advice where are the certificates (server.crt, server.key) stored so it can be used for https access to the CouchPotato? thx

Problem in tiny-tiny-rss:latest: no "git" available

docker run --name="tiny-tiny-rss" --env="VIRTUAL_HOST=rss.my.domain" --link="postgresql:postgresql" --volumes-from="tiny-tiny-rss-data" -it maxexcloo/tiny-tiny-rss
/config/init04: line 3: git: command not found
2015-04-12 19:39:31,269 CRIT Supervisor running as root (no user in config file)
2015-04-12 19:39:31,270 WARN Included extra file "/etc/supervisor/conf.d/tiny-tiny-rss.conf" during parsing
2015-04-12 19:39:31,270 WARN Included extra file "/etc/supervisor/conf.d/php-fpm.conf" during parsing
2015-04-12 19:39:31,271 WARN Included extra file "/etc/supervisor/conf.d/nginx.conf" during parsing
2015-04-12 19:39:31,397 INFO RPC interface 'supervisor' initialized
2015-04-12 19:39:31,398 WARN cElementTree not installed, using slower XML parser for XML-RPC
2015-04-12 19:39:31,398 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2015-04-12 19:39:31,400 INFO supervisord started with pid 19
2015-04-12 19:39:32,405 INFO spawned: 'nginx' with pid 20
2015-04-12 19:39:32,411 INFO spawned: 'tiny-tiny-rss' with pid 21
2015-04-12 19:39:32,421 INFO spawned: 'nginx-config' with pid 22
2015-04-12 19:39:32,429 INFO spawned: 'php5-fpm' with pid 23
2015-04-12 19:39:32,447 INFO spawned: 'php5-fpm-config' with pid 24
2015-04-12 19:39:32,598 INFO exited: tiny-tiny-rss (exit status 1; not expected)
2015-04-12 19:39:33,642 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2015-04-12 19:39:33,645 INFO spawned: 'tiny-tiny-rss' with pid 33
2015-04-12 19:39:33,646 INFO success: nginx-config entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2015-04-12 19:39:33,647 INFO success: php5-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2015-04-12 19:39:33,647 INFO success: php5-fpm-config entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2015-04-12 19:39:33,742 INFO exited: tiny-tiny-rss (exit status 1; not expected)
2015-04-12 19:39:35,751 INFO spawned: 'tiny-tiny-rss' with pid 35
2015-04-12 19:39:35,858 INFO exited: tiny-tiny-rss (exit status 1; not expected)
2015-04-12 19:39:38,867 INFO spawned: 'tiny-tiny-rss' with pid 37
2015-04-12 19:39:38,971 INFO exited: tiny-tiny-rss (exit status 1; not expected)
2015-04-12 19:39:39,974 INFO gave up: tiny-tiny-rss entered FATAL state, too many start retries too quickly

Old /config/loop in nginx-php

It seems that the change to the /config/loop script made in 8c87fde didn't cause a rebuild for nginx-php.

When running:

docker run -it maxexcloo/nginx-php:latest cat /config/loop

I get:

#!/bin/bash
if [ "$(ls -A /config/init)" ]; then
    for init in /config/init/*; do
        bash "$init"
    done
fi
if tty -s; then
    supervisord
    while true; do
        echo "Exit supervisorctl with Ctrl-D. Detach with Ctrl-P + Ctrl-Q."
        supervisorctl
        echo "Exit shell with Ctrl-D. Detach with Ctrl-P + Ctrl-Q."
        bash
    done
fi
supervisord -n

Doesn't Docker rebuild when a file's contents changes?

MariaDB can’t be launched (Supervisor error)

Run command :

docker run -d --name="xxxxx_DB" --volumes-from="xxxxx_DBDATA" -e "MARIADB_USER=xxxxx" -e "MARIADB_PASS=xxxxxxx" --restart=always maxexcloo/mariadb

MariaDB logs :

2016-09-26 12:09:47,104 INFO exited: mariadb (exit status 0; expected)
/usr/lib/python2.7/dist-packages/supervisor/options.py:296: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
  'Supervisord is running as root and it is searching '
2016-09-26 12:23:26,874 CRIT Supervisor running as root (no user in config file)
2016-09-26 12:23:26,874 WARN Included extra file "/etc/supervisor/conf.d/mariadb.conf" during parsing
Unlinking stale socket /var/run/supervisor.sock
2016-09-26 14:17:38,386 CRIT Server 'unix_http_server' running without any HTTP authentication checking

My docker version :

➜  docker -v
Docker version 1.12.1, build 23cf638

Directory structures required etc

Using this, really great stuff. I'm quite new to Docker so it's nice to see some practises in use through other images. Took me a while to get the nginx-php up and running going through logs and seeing what was referenced in configs etc. Perhaps would be helpful to add recommended directory structures.

/data
    /conf
        nginx-*.conf // included by nginx/host.d/default.conf
        php-*.conf // included by php-fpm.conf
    /http
        index.php etc // web dir referenced in nginx/host.d/default.conf
    /logs
        nginx.log
        php-fpm.log

[phpmyadmin] php5-fpm.sock owned by core

Hey, first off - awesome packages, they have saved me a ton of time!

On one of the machines I'm experiencing a weird error - getting a 502 bad gateway when trying to open phpmyadmin in the browser. Upon further investigation it looks like /data/secure/php5-fpm.sock is owned by core:core. As soon as I go inside the container & run chown www-data:www-data /data/secure/php5-fpm.sock, it starts to work.

I tried extending your image by adding a new init script under /config/init/ to have it automatically change the owner. This won't work, because the owner seems to be overwritten when the supervisor is started.

I'm running docker v1.3.0 & fig v0.5.2. It's weird that another machine with a similar setup has no such problems and happily opens up phpMyAdmin.

What might be causing this?

Thanks,
Kristen

Insecure writable by web user /data directory in nginx-php package

Hello.

In the init script recursively change /data owner to core:core. The php5-fpm process is also executed under user core. This is insecure. Basically every script can change everything in /data, including config files. The /data/secure folder is not secure too. Every web script can access it.

I wonder is there any reason why you recursively update the owner of /data directory? I would suggest leaving file owners intact and only changing the file owner of logs directory. I also suggest to run php5-fpm under www-data user.

Cannot upload files larger than 4KB

I have an image based on maxexcloo/nginx-php and shared with a local directory. Everything seems to work fine but I cannot upload files over 4kb in size :( . I get the following error from nginx:

open() "/var/lib/nginx/body/0000000001" failed (13: Permission denied), client: 192.168.99.1, server: localhost, request: "POST /tools/upload.php HTTP/1.1", host: "192.168.99.100:32774", referrer: "http://192.168.99.100:32774/tools/upload.php"

Nginx error

root@d4ab265f15d7:/# nginx -t
nginx: [emerg] "pcre_jit" directive is not allowed here in /etc/nginx/nginx.conf:8
nginx: configuration file /etc/nginx/nginx.conf test failed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.