Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yevheniidatsenko/goit-cs-hw-02
💾 Hometask - Computer Systems (Operating system basics)
https://github.com/yevheniidatsenko/goit-cs-hw-02
bash docker goit-cs-hw-02
Last synced: 16 days ago
JSON representation
💾 Hometask - Computer Systems (Operating system basics)
- Host: GitHub
- URL: https://github.com/yevheniidatsenko/goit-cs-hw-02
- Owner: yevheniidatsenko
- Created: 2024-12-07T20:32:01.000Z (27 days ago)
- Default Branch: main
- Last Pushed: 2024-12-09T13:37:03.000Z (25 days ago)
- Last Synced: 2024-12-09T14:28:28.580Z (25 days ago)
- Topics: bash, docker, goit-cs-hw-02
- Language: Python
- Homepage:
- Size: 2.57 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Fundamentals of Operating Systems - Module Assignment
## Task 1: Website Availability Checker
### Objective
Write a Bash script to check the availability of specific websites and log the results.
### Implementation
- **Website List**: Defined an array with URLs (`https://google.com`, `https://facebook.com`, `https://twitter.com`).
- **Availability Check**: Used the `curl` command to send HTTP GET requests and verified responses with status code 200.
- **Logging**: Results are saved in a file named `website_status.log` with a clear format (e.g., "https://google.com is UP").
- **Redirection Handling**: Configured `curl` to follow URL redirections.
- **Output Message**: Displayed a message confirming that results were logged.### Outcome
The script successfully:
- Checked website availability.
- Logged results in `website_status.log`.
- Provided clear feedback after execution.---
## Task 2: FastAPI Application in Docker
### Objective
Set up a FastAPI application in Docker, integrated with a PostgreSQL database.
### Implementation
- **Dockerfile**: Created to build the Docker image for the FastAPI application.
- **docker-compose.yaml**: Configured to deploy the FastAPI app and PostgreSQL as separate services.
- **Database Connection**: Updated `SQLALCHEMY_DATABASE_URL` to use the PostgreSQL service name from `docker-compose.yaml` for seamless connectivity.
- **Environment Setup**: Used `docker-compose up` to build and start the environment.### Outcome
- Successfully deployed the FastAPI application in a Docker container.
- Verified database connectivity using the "Check DB" button in the FastAPI interface.
- Ensured full functionality of the application and database.