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