Python app that returns the current time using fastAPI
This project is dockerized. You can run it using Docker. Make sure you have Docker installed and running on your machine.
You can run it by building the image and then running the container, or you can pull the image from Docker Hub and run it directly.
docker pull teg57/sol_i_webdocker run --rm -p 8000:8000 sol_i_webClone the repository to your local machine and then build the image using the following commands:
docker build -t sol_i_web .docker run --rm -p 8000:8000 sol_i_webMake sure that you have a python version greater or equal to 3.12. Then:
Clone the repository:
git clone https://github.com/AlanSilvaaa/sol_i_web.gitRun the next command to install poetry:
pip install poetryInstall depencencies along with a poetry enviroment:
poetry install --no-rootFinally go to src folder and run this command to run the source code:
poetry run uvicorn main:app --port 8000There are two ways to test the API, using a browser or using curl.
After the local server is started, go to your browser and type the following URL:
127.0.0.1:8000/timeTo visualize the result of the local server you can use Curl:
curl http://127.0.0.1:8000/timeIf you local server is running fine, it should return something like:
{"Date and time": "2025-04-06 12:34:56"}Here you can find the docker image on Docker Hub.