This assignment will guide you through designing and deploying a 3-tier application architecture using Docker Compose. The 3-tier architecture includes a web server (frontend), an application server (backend), and a database server (DB). Each tier is containerized and orchestrated using Docker Compose.
You will create a simple web application with the following components:
- Web Server (Frontend): A Nginx server to serve static content and act as a reverse proxy for the application server.
- Application Server (Backend): A Python Flask application that handles business logic and interacts with the database.
- Database Server: A PostgreSQL database to store application data.
- Use PostgreSQL as the database.
- Initialize the database with a schema and some sample data.
- Expose the necessary port to allow the application server to connect.
- Create a Flask application that:
- Connects to the database to fetch and store data.
- Exposes RESTful APIs for the web server to consume.
- Use environment variables to configure database credentials.
- Use Nginx to serve static files.
- Configure Nginx as a reverse proxy to forward API requests to the application server.
- Define all three services (
web,app,db) in adocker-compose.ymlfile. - Set up networking to allow communication between the services.
- Use Docker volumes for persistent data storage.
- A
docker-compose.ymlfile to orchestrate the services. - Configuration files for the database, application, and web server.
- A fully functional 3-tier application accessible from the browser.
- A
README.mdwith clear setup and deployment instructions.