A multi-container, Compose configured, web application.
- Application overview
- Requirements
- Running the application stack
- Running the application in development mode
The application is composed of the following parts:
- Express server running on Node.js;
- MySQL relational database with a persistent volume;
- Nginx serving the application as a reverse proxy;
(External user)
|
8080
|
+-----------+
| nginx |
| service |
+-----------+
|
+-----------+
| node.js |
| service |
+-----------+
|
+-----------+ ______________
| mysql | r+w ( persistent )
| service |=======\ volume /
+-----------+ \__________/
All application services are configured in the Compose file.
- Docker ≥ 20.10.17
To run the application services:
$ docker compose up --build
To check the application containers status:
$ docker compose ps
The web application listens on port 8080
. To access the application, open a web browser and go to the following address:
http://localhost:8080
To stop the application services:
$ docker compose down
In development mode, the application source code is bind mounted into the running container, and nodemon automatically restarts the application when file changes are detected. These configuration are defined in the Compose development file.
To run the application in development mode:
$ docker compose -f compose.yaml -f compose.dev.yaml up --build