we are considering to migrate our Django app to Qovery. It is located in a monorepo where we use Pants as the build tool. As far as I have understood, one option to deploy an app on Qovery is using a Dockerfile, which we do.
However, we use Pants to build that Dockerfile as it has certain dependencies as defined by pants. Can we use this to deploy with Qovery? Usually, we would publish it to a container repository and then use it for deployment.
We are still in the process of adopting Pants, so I cannot share any final Dockerfile. But it will be similiar to the example:
FROM python:3.8
ENTRYPOINT ["/bin/helloworld"]
COPY src/docker/hw/msg.txt /var/msg
COPY src.python.hw/bin.pex /bin/helloworld
Here the dependency inference does the magic. This is a very basic inference, but I can add other dependencies to this Docker image target, e.g. building another Docker image that serves as the base image for my application image. Did you get the idea?
As a note: The src.python.hw/bin.pex is not a file that you commit but will be packaged in CI. Due the Pants dependency inference, as the Docker target depends on the Pex binary target.
Ok, I get the idea (I didn’t know about Pants). And when you run docker build -f Dockerfile -t python:pants . locally the container is built correctly?
The django_image has two dependencies, namely a base image and the source artifact, which are required in the Dockerfile which looks as follows:
FROM my-custom-base-image
COPY src.python.hw/bin.pex /bin/helloworld
ENTRYPOINT ["/bin/helloworld"]
Now I can run ./pants package django:django_image (do not get confused by the django prefix, this is just the folder in the monorepo and I run the pants command from the root of the monorepo) which builds the Docker image (see source="Dockerfile" in the first target) and makes sure through the dependencies array that the base image and the Pex binary are build/packaged beforehand. The result is a Docker image with the tag my-django-image which I can run the way I want, e.g. with docker run my-django-image or push it to a registry, e.g. AWS ECR and and use it for an AWS ECS task.
I hope this got clear now. Looking forward to hear your thoughts!
From what I understand you will need to be able to deploy right from your container registry with Pants. Because your final image is actually based on FROM my-custom-base-image which is not available on a public registry right?
We started working on this feature but we had to pause it at the moment. I can see with my team when we’ll deliver it.
Side note: You can subscribe to our public roadmap and vote for the feature you need.
docker build -t my-django-image -f Dockerfile (the base image is present in the current environment and does not need to be pulled from a regsitry)
That is why I was asking if one can provide a custom docker build command. If Qovery just runs docker build on the provided Dockerfile, that would obviously not work. Is there any resource to understand what Qovery is doing with that Dockerfile?
Which feature are you referring to? That private registry images can be pulled?
Thank you for all the information! Would really appreciate to get an ETA for this feature as this is a real block to migrate to Qovery unfortunately. Cheers!
Sadly, we don’t have any means to subscribe to specific features.
But you can subscribe to qovery newlestter (email) or follow us on linkedin in order to receive new features released.