Go to file
2026-03-30 08:28:42 +00:00
z1 Añadir z1/README.md 2026-03-30 08:28:42 +00:00
app.py Assignment 1 Docker 2026-03-30 08:20:48 +00:00
docker-compose.yaml Assignment 1 Docker 2026-03-30 08:20:48 +00:00
Dockerfile Assignment 1 Docker 2026-03-30 08:20:48 +00:00
index.html Assignment 1 Docker 2026-03-30 08:20:48 +00:00
nginx.conf Assignment 1 Docker 2026-03-30 08:20:48 +00:00
prepare-app.sh Assignment 1 Docker 2026-03-30 08:20:48 +00:00
README.md Assignment 1 Docker 2026-03-30 08:20:48 +00:00
remove-app.sh Assignment 1 Docker 2026-03-30 08:20:48 +00:00
requirements.txt Assignment 1 Docker 2026-03-30 08:20:48 +00:00
start-app.sh Assignment 1 Docker 2026-03-30 08:20:48 +00:00
stop-app.sh Assignment 1 Docker 2026-03-30 08:20:48 +00:00

Assignment 1 Docker Notes App

Overview

This project is a simple Notes Application built using Docker.
It demonstrates how to run a multi-container application composed of:

  • Frontend (Nginx)
  • Backend (Flask REST API)
  • Database (PostgreSQL)

The application allows users to:

  • Add notes
  • View saved notes
  • Delete notes

All data is stored persistently using a Docker volume.


Architecture

The application consists of three services:

1. Frontend

  • Technology: Nginx
  • Serves static HTML page
  • Proxies API requests to backend
  • Accessible via browser

2. Backend

  • Technology: Python (Flask)
  • Provides REST API:
    • GET /api/notes
    • POST /api/notes
    • DELETE /api/notes/{id}
  • Connects to PostgreSQL database

3. Database

  • Technology: PostgreSQL 16
  • Stores notes data
  • Uses persistent Docker volume

Networking

All containers are connected via a Docker virtual network:

  • Network name: zkt_net

This allows communication between:

  • frontend → backend
  • backend → database

Persistent Storage

  • Volume name: zkt_db_data
  • Purpose: store PostgreSQL data
  • Ensures data is not lost after stopping containers

Containers Used

Container Name Description
zkt_frontend Nginx web server
zkt_backend Flask API
zkt_db PostgreSQL database

Requirements

  • Docker
  • Docker Compose (plugin)
  • Linux / WSL / Docker Desktop
  • Web browser

How to Run the Application

1. Prepare the application

./prepare-app.sh

### 2. Start the application 

./start-app.sh

### Then open your browser:

 http://localhost:8080 
 
 
### 3. Stop the application
./stop-app.sh

### 4. Remove the application
./remove-app.sh

## Testing the Application

-Open the web interface
-Add a note
-Verify it appears in the list
-Stop and restart the app:
./stop-app.sh
./start-app.sh
-Refresh the page

## If the note is still there → persistence works correctly

## Key Concepts Demonstrated

-Multi-container Docker application
-Docker Compose usage
-Container networking
-Persistent storage with volumes
-REST API communication
-Reverse proxy with Nginx

## Use of Artificial Intelligence

Artificial intelligence was used to:

-Design application architecture
-Generate initial code (frontend, backend, Docker config)
-Explain Docker concepts
-Assist with debugging and troubleshooting
-Prepare documentation

## Tool used:

-ChatGPT
-Gemini

## Pablo Pérez Arcas