This project uses Docker-Compose to orchestrate a ToDo list application that encompasses several microservices. The architecture consists of backend servers, a socket server, a database, Redis, a frontend, an Nginx proxy, and phpMyAdmin.
./server- Source code for the backend servers../socket-server- Source code for the socket servers../db- Dockerfile and configuration for the MySQL database../frontend- Source code for the frontend../nginx- Nginx configuration.
- server-1: Backend servers that handle requests and access MySQL.
- socket-server-1: Socket.IO server for real-time communication.
- todolistdb: MySQL database for the application.
- phpmyadmin: Web interface for managing the MySQL database.
- frontend: Frontend application.
- nginx: Nginx proxy that forwards requests to the backend servers and frontend.
- redis: Redis database for real-time data storage.
- Docker and Docker Compose must be installed.
-
Clone the Repository
git clone https://github.com/JonasPfi/SynchronizedDistributedTodoList.git
-
Create .env File
Copy the
.env.examplefile and adjust the values for your environment:cp .env.example .env
-
Start Docker Containers
Start the Docker containers in the background:
docker-compose up -d
-
Check
- phpMyAdmin: http://localhost:8085
- Nginx: http://localhost:80
-
View Logs
To view the logs of a specific container:
docker-compose logs <SERVICE_NAME>
Example:
docker-compose logs frontend
-
Stop Containers
To stop and remove all containers:
docker-compose down
The .env file contains the following variables:
MYSQL_DATABASE- Name of the MySQL database.MYSQL_USER- Username for the MySQL database.MYSQL_PASSWORD- Password for the MySQL database.MYSQL_HOSTNAME- Hostname for the MySQL database.FRONTEND_PORT- Port for the frontend.FRONTEND_URL- URL for the frontend.SERVER_PORT- Port for the backend servers.SERVER_URL- URL for the backend servers.SOCKET_IO_PORT- Port for the Socket.IO servers.SOCKET_IO_URL- URL for the Socket.IO servers.VITE_NGINX_URL- URL for Nginx.REDIS_PORT- Port for Redis.
Ports may need to be adjusted in the docker-compose.yaml & nginx.conf files!
- Jonas Pfingstag
- Julian Schurr