For any deployment to work in TrueFoundry, its essential to have a docker registry integrated with TrueFoundry. This should have been already done by the Infra team during the setup step.
You already have a docker image built and pushed to your registry.
You already have a docker image built and pushed to your registry.
To deploy a already present docker image, choose the option of Choosing the docker registry is optional - TrueFoundry will automatically try to check if the image is present in any of the integrated registries.
Docker Image
in the Service Deployment form.Your code is in a git repository and the Git repository is integrated to TrueFoundry. You have written a dockerfile to build your code
Your code is in a git repository and the Git repository is integrated to TrueFoundry. You have written a dockerfile to build your code
- Select the Git Repo option in the Service Deployment form

- Choose your repository in the Repo URL box and the option
Dockerfile (I already have DockerFile)
in the Build section.
- Path to Build Context: This is the path in the Git repository where the code to be deployed is present. Usually this is the root directory of the Git repo and the value is
"./"
, however, if you have multiple services in the same repo, you can specify the path to the directory containing the service you want to deploy - for e.g."my-service/"
. - Path to Dockerfile: This is the path to the Dockerfile in the Git repository - relative to the
Path to Build Context
. For e.g. if the Dockerfile is present in themy-service
directory, and you have provided the build context as"my-service/"
, then the path to the Dockerfile is"./Dockerfile"
. However, if thePath to Build Context
is"./"
, then the path to the Dockerfile should be"./my-service/Dockerfile"
.

Your code is in a git repository and the git repository is integrated with TrueFoundry. You don't have a Dockerfile in the Git repository
Your code is in a git repository and the git repository is integrated with TrueFoundry. You don't have a Dockerfile in the Git repository
This option only works for Python code that uses requirements.txt to manage dependencies. For other frameworks and languages, you will need to write a Dockerfile and follow the option 2 above.
- Select the Git Repo option in the Service Deployment form

- Choose your repository in the Repo URL box and the option
Python Code (I don't have Dockerfile)
in the Build section.
- Path to Build Context: This is the path in the Git repository where the code to be deployed is present. Usually this is the root directory of the Git repo and the value is
"./"
, however, if you have multiple services in the same repo, you can specify the path to the directory containing the service you want to deploy - for e.g."my-service/"
. - Path to requirements.txt: This is the path to requirements.txt in the Git repository - relative to the
Path to Build Context
. For e.g. if the requirements.txt is present in themy-service
directory, and you have provided the build context as"my-service/"
, then the path to the requirements.txt is"./requirements.txt"
. However, if thePath to Build Context
is"./"
, then the path to the requirements.txt should be"./my-service/requirements.txt"
. - Python Version: This is the Python version to be used to build the image. This should be the same Python version using which the code has been written and tested.
- Command: This is the command to be used to run the code. This should be the same command which you are using to run the code locally.

Your code is only on your laptop and you want to deploy it
Your code is only on your laptop and you want to deploy it
- Select the option
Code From Laptop
in the Service Deployment form.

- Follow the steps to install truefoundry cli and login to truefoundry.

- Fill up the deployment form with the following key fields:
- Service Name: You can give any name which will later be used to identify the service in the TrueFoundry platform.
- Source Code (Build and deploy Source Code): If you have already written a Dockerfile locally, choose the option
Dockerfile (I already have DockerFile)
, else choose the optionPython Code (I don't have Dockerfile)
. The second option will work if you have Python code locally and a requriements.txt file containing the dependencies. The description of the fields can be found in the previous sections. - Ports: This is the port on which the service will be exposed. It will be the same port on which the service is running locally.
- Resources: You can start with the default values and later change after the first deployment.
- Download the deploy.py file, place it in the root of your project. Run it from the same directory where deploy.py is present. The command to run it will be: