Youtube Autonomous FastAPI Docker Base Module
Project description
Youtube Autonomous FastAPI Docker Base Module
The module that is handled by a docker container to isolate the environment we need for each purpose, exposed by a FastAPI that allows asking for the specific resources.
This project is using poetry to handle the dependencies and the virtual environment, and docker to manage the specific python version and all the code with the app to be executed.
Instructions
Generate the image
We need to generate the docker image with all the things we need to be able to run the app inside.
- Use the
$ docker build --no-cache -t {LIBRARY_NAME} .command to generate the Docker image by using thedockerfilefile and ignoring the caché. This will download thepython 3.12.xversion, install the dependencies and copy the code. Use this if any dependency has changed since the last time. If you are just updating the code, you can use the following instead. - Use the
$ docker build -t {LIBRARY_NAME} .command to generate the Docker image by using thedockerfilefile. It will download thepython 3.12.xversion, install the dependencies and copy the code, each of these steps only if needed (the cache will make it be ignore if it didn't chane).
Run the container
We need to run the container, so it will be mounted and the app will be runing and ready to use.
- Use the command
$ docker rm -f {LIBRARY_NAME} 2>nulto remove the previous container if existing, so we are able to mount it again from zero. - Use the command
$ docker run -d -p "%port%":8000 --name {LIBRARY_NAME} {LIBRARY_NAME}to run and mount the container and make the app be ready to use.
The docker will run uvicorn in the port 8000 internally, but our navigator will redirect the 8001 to that one, so we can have different docker containers working at the same time to provide different services using the same base (uvicorn + fastapi).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yta_fastapi_docker_base-0.0.1.tar.gz.
File metadata
- Download URL: yta_fastapi_docker_base-0.0.1.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.0 CPython/3.9.0 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff8c19d04dcd4b441bf15e48066839ee59ffcbeb17c97240faaf1001c50f5b9b
|
|
| MD5 |
70f7ade5543800688f3bccb04cb7b62d
|
|
| BLAKE2b-256 |
d6e05630e53b3035d036f92107f97612c7ab91a0a2f71076ef64e9610e30c7e8
|
File details
Details for the file yta_fastapi_docker_base-0.0.1-py3-none-any.whl.
File metadata
- Download URL: yta_fastapi_docker_base-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.0 CPython/3.9.0 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7cb58fc0c02ff9fe1858f5d8f82dadb5b1a3dec238e28dfbc98244b718c6b530
|
|
| MD5 |
87b3499f919f8d82da08e54f95199b6d
|
|
| BLAKE2b-256 |
cb8d868e551a93cfb97e99bbed47a0e2e939865c126aecd51b9f78336c00dbd8
|