Deploying using Dockerfile target

Hi,

I would like to know if it’s possible to specify a Dockerfile target for deployment ?

Thanks a lot

Hi @Orkin , what do you mean by a Dockerfile target? Do you mean that you want to use a Dockerfile to deploy your application? In this case, yes, it’s possible, even the default option with Qovery. You can take a look at this documentation.

Hi @rophilogene I’m mean when using docker file like this

FROM php:8.0-apache-buster as apache_php

...

FROM apache_php AS apache_php_dev

... or ...
FROM XXX as redis

With docker-compose you can choose the target : apache_php for docker-compose global and for dev or in docker-compose override change the target by apache_php_dev. You can use 1 Dockerfile to for many containers

When using Qovery only the last FROM instruction is used and I didn’t find how to specify I would like to use apache_php as target and not apache_php_dev with that I can use only 1 Dockerfile for the project

Indeed, with Qovery, you can have multiple Dockerfile and specify the one that you want to use. Can you tell me more about your use case of using one Dockerfile and specify the target?

Because many project like Symfony provide an official support of docker with a Dockerfile that you can find here (for example) : GitHub - dunglas/symfony-docker: A Docker-based installer and runtime for Symfony. Install: download and `docker compose up`. . This Dockerfile is optimised for production and development purpose using target. There is not specific use case it’s juste QOL feature to support target in Dockerfile in this case no more work is needed to use Qovery

bumping this, this is the current recommended way to handle Dockerfiles to minimize size / build time and the fact that it isn’t supported is pretty disappointing.

Hi @macwilk you can do it by building by yourself your container and using Qovery CLI with container application. You can find documentation here : Application | Docs | Qovery and here How to integrate Qovery with GitHub Actions | Qovery

If your application is deployed from an image registry…

Ah yeah, our app is deployed straight from GitHub and really wanted to avoid more work here that seems unnecessary in the short to medium term.

I think if that’s the only solution Qovery is willing to accept here, just another line in the “reasons to just contract out a devops engineer ASAP and get off Qovery” line for us haha

It’s your choice of course. But in my experience you can switch from github application to container application in only few hours and for so much less than a devops engineer :stuck_out_tongue_winking_eye: (but maybe your use case is more complicated than mine)

  • Create a registry on aws
  • Use github action to build you container (instead of Qovery)
  • Use Qovery CLI to start deploying your application