Docker compose samples for applications
Application samples for project development kickoff
Link to the original post on docker blog: https://www.docker.com/blog/awesome-compose-app-samples-for-project-dev-kickoff
Installing Docker and docker-compose
I usually use the following steps to get docker and docker-compose installed:
|
|
1.25.4 is current stable release of docker-compose for now
Updated instructions can be found here for docker and here for docker-compose.
awesome-compose repository
To Clone the repository localy:
|
|
At the root of each sample there is the docker-compose.yml. It contains the definition and the structure of the application and instructions on how to wire the components of the application.
nginx-flask-mysql sample
To start a sample stack with nginx, a flask app and mysql database, you can do the following
|
|
Check there are three containers running, one for each service:
|
|
Since the 80 port is mapped to the host using the stack, you can use curl to test the application:
|
|
This will work with most of the examples out of the box
Modify and update the application sample
Once you made modification to the sample, you can restart the services
|
|
If you have made modifications in the Dockerfile, you will need to do the following to bring the whole stack down, and build the docker image again.
|
|
Samples of Docker Compose applications with multiple integrated services
ASP.NET / MS-SQL
- Sample ASP.NET core application with MS SQL server database.Go / NGINX / MySQL
- Sample Go application with an Nginx proxy and a MySQL database.Go / NGINX / PostgreSQL
- Sample Go application with an Nginx proxy and a PostgreSQL database.Java Spark / MySQL
- Sample Java application and a MySQL database.NGINX / Flask / MongoDB
- Sample Python/Flask application with Nginx proxy and a Mongo database.NGINX / Flask / MySQL
- Sample Python/Flask application with an Nginx proxy and a MySQL database.NGINX / Go
- Sample Nginx proxy with a Go backend.React / Spring / MySQL
- Sample React application with a Spring backend and a MySQL database.React / Express / MySQL
- Sample React application with a Node.js backend and a MySQL database.React / Rust / PostgreSQL
- Sample React application with a Rust backend and a Postgres database.Spring / PostgreSQL
- Sample Java application with Spring framework and a Postgres database.
Single service samples
Basic setups for different platforms (not production ready - useful for personal use)
Gitea / PostgreSQL
Nextcloud / PostgreSQL
Nextcloud / Redis / MariaDB
Wordpress / MySQL
Prometheus / Grafana