Deploy Symfony 5 App with Docker on Qovery?

Hello ! I would like to deploy a Symfony5/mysql application on Qovery. Can you tell me more about the recommended steps? The project is already setup on Docker. What’s the next steps? Thanks

Hi, can you copy paste your Dockerfile in order to know what you already set up? :wink:

1 Like

Hi, we use docker-compose.yml:

###############################################################################
#                             DOCKER-COMPOSE.YML                              #
###############################################################################

version: "3.8"

services:
  # LISTE DES SERVICES (Conteneur).

  # MYSQL
  mysql:
    image: mysql:8.0
    container_name: mysql_docker_symfony
    restart: always
    volumes:
      - db-data:/var/lib/mysql
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
    networks:
      - dev

  # PHPMYADMIN
  phpmyadmin:
    image: phpmyadmin
    container_name: phpmyadmin_docker_symfony
    restart: always
    depends_on:
      - mysql
    ports:
      - "8080:80"
    environment:
      PMA_HOST: mysql
    networks:
      - dev

  # MAILDEV
  maildev:
    image: maildev/maildev
    container_name: maildev_docker_symfony
    command: bin/maildev --web 80 --smtp 25 --hide-extensions STARTTLS
    ports:
      - "8081:80"
    restart: always
    networks:
      - dev

  # PHP 8.0.3
  php:
    image: anvil34/gregouz_php8.0.3:1.0
    container_name: www_docker_symfony
    ports:
      - "8741:80"
    volumes:
      - ./docker/vhosts:/etc/apache2/sites-enabled
      - ./:/var/www/
    restart: always
    networks:
      - dev

  # ENCORE
  encore:
    image: node:16-alpine3.11
    container_name: encore_docker_symfony
    volumes:
      - ./:/var/www/
    working_dir: /var/www/
    command: ["yarn", "watch"]

# RESAUX & VOLUMES
networks:
  dev:

volumes:
  db-data:

There’s the dockerfile

###########
# Backend #
###########

# Import official Docker Image of PHP 8.0.3 for Apache
FROM php:8.0.3-apache

# Name the server: localhost
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf

# Get the last update of the server
RUN apt-get update \
    && apt-get install -y --no-install-recommends locales apt-utils git libicu-dev g++ libpng-dev libxml2-dev libzip-dev libonig-dev libxslt-dev;

# Encode UTF-8
RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
    echo "fr_FR.UTF-8 UTF-8" >> /etc/locale.gen && \
    locale-gen

# Install extensions of PHP
RUN docker-php-ext-configure intl
RUN docker-php-ext-install pdo pdo_mysql gd opcache intl zip calendar dom mbstring zip gd xsl
RUN pecl install apcu && docker-php-ext-enable apcu

# Install Composer
RUN curl -sSk https://getcomposer.org/installer | php -- --disable-tls && \
   mv composer.phar /usr/local/bin/composer

# Install Symfony CLI
RUN curl -sS https://get.symfony.com/cli/installer | bash
RUN mv /root/.symfony/bin/symfony /usr/local/bin/symfony

# Define the work directory
WORKDIR /var/www/

# Allow all the rights of user to become root
ENV COMPOSER_ALLOW_SUPERUSER=1

Thanks,

First of all I think Qovery do not support docker-compose file for the moment :confused:

1 Like

(I’m french btw) Thanks for the reply
Is there a way to solve this by having only a dockerfile?

Yes we don’t support Docker compose file yet. We expect to support it one day. There is no release date at the moment - but it’s probably be released in beta for the end of the year. You can vote here

Yes using the Dockerfile it’s possible. This is the main way to deploy with Qovery. You only need to put your Dockerfile at the root of your problem. You have a list of tutorials here.

1 Like