Quickly setup multiple websites via Docker containers on a single server.
- Traefik: This project uses Traefik to load balance and route traffic to each site.
- Static Sites: Sites use
Nginxto serve the files and
PHPto interpret. You can replicate your own sites within each
- MySQL: Use this container if you'd like to run a database for your application. Alternatively, you can combine the contents of this docker-compose file with the docker-compose file of your site.
- Install Docker
- Navigate to each directory in this project and run
docker-compose up -dstarting with
Traefik. Traefik can either host insecure content or SSL content. If using the SSL Traefik docker-compose command, each service will receive its own SSL certificate provided by
Traefik. Traefik will take care of automatically renewing these certs as well. Navigate to either the
/ssldirectory based on your needs.
- Start up each of your sites using
docker-compose up -din the directory of the site. Replicate the
sitefolder structure as needed for other projects and update accordingly. Drop in your html/php files to each directory.
NOTE: If using the SSL Traefik config, you'll need to edit the
traefik.toml file in that directory. There is a line to add your email and default domain. These will be used to register each SSL cert. Without this information, it won't run.
There you go! You have a fully functioning multisite Docker server running the latest versions of Nginx and PHP, each with their own SSL certificate - all automated and virtualized. Easily transfer your entire server to another machine, scale your services quickly, or share your projects with others.