Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luciaheredia/clockapp
Clock App
https://github.com/luciaheredia/clockapp
docker-compose dockerfile flask-application html python python3
Last synced: 5 days ago
JSON representation
Clock App
- Host: GitHub
- URL: https://github.com/luciaheredia/clockapp
- Owner: LuciaHeredia
- Created: 2025-01-24T17:34:01.000Z (10 days ago)
- Default Branch: master
- Last Pushed: 2025-01-25T11:24:24.000Z (9 days ago)
- Last Synced: 2025-01-25T11:25:56.836Z (9 days ago)
- Topics: docker-compose, dockerfile, flask-application, html, python, python3
- Language: Python
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Flask Clock App with Docker:
## Missions:
### Clock App (clock_app):
- It displays the current time.
- Exposes an **API endpoint** to decrement the time. \
### Button App (button_app):
- Contains a button to decrement the time.
- Communicates with the **clock_app** by making a POST request to the **API endpoint**. \
## Structure:
```
project_folder/
├── apps/
│ ├── clock_app/
│ │ ├── clock_app.py
│ │ ├── Dockerfile
│ │ ├── requirements.txt
│ │ ├── templates/
│ │ └── ...
│ └── button_app/
│ ├── button_app.py
│ ├── Dockerfile
│ ├── requirements.txt
│ ├── templates/
│ └── ...
└── docker-compose.yml
```## Steps:
### Flask Apps:
- Two directories: **clock_app** and **button_app**.
- In each directory: Python files (**app.py**) and templates(**index.html**).
- In the Python files: **button_app** communicates with **clock_app** using the *requests* library.
- **clock_app**: Displays the current time and updates it upon **API endpoint** request (/update_time) .
- **button_app**: Contains a button to decrement the time and communicates with **clock_app** via **API endpoint**.
- In each directory: requirements file (**requirements.txt**: *Flask*, *requests*).
### Dockerfiles:
- In each directory: **Dockerfile** for the Docker image configuration.
### Docker Compose File:
- In the project root: docker-compose file (**docker-compose.yml**).
- *Services* for both **clock_app** and **button_app**: *build contexts*, *ports* and *environment*(in **button_app**).
- Default *network* for communication between the two containers.
- Build and Run the Containers:
```
docker-compose up --build
```
### Access the Apps:
- **clock_app** available at http://localhost:5001.
- **button_app** available at http://localhost:5002.