This file belongs to: github.com/realFranco.
Objetive of this project.
Create a set of vm using docker
and interconnect each of them.
There will be a communication layer using a REST API.
As an MVP: Simulate the "intelligent tearing" service from s3.
Other elements could be practice bridges like github actions or gitlab pipelines.
Running example:
python3 main.py
Required for centralize services, execute tests, static code analysis and open the service connection
docker compose -f .docker/compose.yml build
# Ref: https://docs.docker.com/engine/reference/commandline/compose_up/
docker compose -f .docker/compose.yml up
# Starts the containers in the background and leaves them running.
docker compose -f .docker/compose.yml up --detach
# Get the name of the existing container (exited and running services)
docker ps -a
# Instance a bash shell in the container
docker exec -it <container name> [ /bin/bash | bash | sh ]
# Turn off the all the services, make sure to run this to release the resources provisioned into the host.
docker compose -f .docker/compose.yml down
docker compose -f .docker/compose.yml build
docker compose -f .docker/compose.yml run --rm cli <your-command>
docker compose -f .docker/compose.yml down
docker compose version
>
Docker Compose version v2.15.1
docker version
>
Client:
Cloud integration: v1.0.29
Version: 20.10.22
API version: 1.41
Go version: go1.18.9
Git commit: 3a2c30b
Built: Thu Dec 15 22:28:41 2022
OS/Arch: darwin/arm64
Context: default
Experimental: true
# Previously, install `postgres` in order to check if is ready for accepting connections.
pg_isready --host=$POSTGRES_HOST --username=$POSTGRES_USER --port=$POSTGRES_PORT
>
host:5432 - accepting connections
# Connect into the db from the `cli` container
psql -h $POSTGRES_HOST -p $POSTGRES_PORT -U $POSTGRES_USER -d $POSTGRES_DB
# Previously, install `redis-cli` in order the check if is ready for accepting connections.
redis-cli -h $REDIS_HOST -p $REDIS_PORT PING
curl -v http://0.0.0.0:8005
curl -v http://localhost:8005
curl -v http://localhost:8005/
curl -v http://0.0.0.0:8000
python3 -m venv env
source env/bin/activate
pip3 install -r src/requirements.txt
uvicorn src.main:app --host 0.0.0.0 --port 8000
# To remove the virtual env.
deactivate
I wrote
bahrain-international-circuit
as the network bridge name becuase I was doing the project while observing the Qualy from the F1 Grand Prix at Bahrein Circuit.You can rename as you want it.