Skip to content

Dockerfile for Nginx, PHP-FPM with mSMTP. Includes Traefik support, Swarm support, MariaDB, Backup.

Notifications You must be signed in to change notification settings

RaveMaker/docker-nginx-php-fpm

Repository files navigation

Docker: Nginx with PHP support

Dockerfile for PHP with mSMTP client.

docker-compose file includes:

  • Nginx
  • PHP-FPM
  • MariaDB
  • Backup
  • Docker Swarm support
  • Traefik v2 support

Setup:

  1. clone the repo
  2. create .env file from .env.example
  3. create msmtp/msmtprc from msmtp/msmtprc.example
  4. copy one of the docker-compose (dev/traefik) templates to docker-compose.yml
  • to create a docker-compose.prod.yml file for docker swarm run:
docker-compose config > docker-compose.prod.yml

Network settings:

The stack is divided into two networks, backend and frontend.

the idea behind splitting the stack into two networks is to block the access of the reverse proxy to the backend containers.

both networks are unique and will be named with stack-name_network-name such as:

  • docker-nginx-php-fpm_backend
  • docker-nginx-php-fpm_frontend

after running docker-compose up you need to connect your reverse proxy to your new frontend network: you can do that manually using:

docker network connect docker-nginx-php-fpm_frontend PROXY_CONTAINER_NAME

if you are using my Traefik setup there is a 'connect.sh' script included that will connect all your frontend networks to your Traefik container.

Author: RaveMaker.

About

Dockerfile for Nginx, PHP-FPM with mSMTP. Includes Traefik support, Swarm support, MariaDB, Backup.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published