2765d918619b36bf7f8d18a1f5d3dad3fed764e6
python-3-8-fastapi
Base Image
Building the base image requires access to docker.sciocatti.com to pull the docker.sciocatti.com/python:3.8-slim image. Pulling this base image also requires access. If you do not have access to this registry, you can
- create your own image by replacing
docker.sciocatti.com/python:3.8-slimwithpython:3.8-sliminbase_image/Dockerfile.python-3-8-fastapi, and - building the dockerfile and using that as the base.
- Optionally, you can push that to your own registry.
If you do have access you can update the base image by
- Updating
base_image/Dockerfile.python-3-8-fastapi, and - Running the following:
cd base_image # Build docker build -f Dockerfile.python-3-8-fastapi -t docker.sciocatti.com/python-3.8-fastapi:{{tag}} . # Push docker push docker.sciocatti.com/python-3.8-fastapi:{{tag}}
Installed libraries
- FastApi
- Python-dotenv
- Requests
- MySQL / MariaDB connector
Changing this from the template
This is almost ready to go as-is, you just need to make some tweaks:
- Change the port in
deploy/run.sh. By default the app will be running on port 64000 on your host. - Change the name of the output image in
deploy/build.shand potentially disable the push to the registry. - Change the K3S deployment details in
deploy/deployment.yaml. This is made specifically for my cluster, so adapt for yours if using yours.
Running & Building
Running
You only need docker to run this, and access to relevant images.
# In project root
bash run.sh
Building
# In project root
bash build.sh
Deploying
- Update dockerfile.
- Build the image.
- Push the image.
- Restart deployment in cluster.
Description
Languages
Python
55.4%
JavaScript
27.5%
HTML
10.4%
Shell
3.7%
Dockerfile
2.5%
Other
0.5%