title: docker-compose image don't run rpoperly, but it does using a dockerfile
body: <p>I've got the following docker-compose</p>
  <pre><code>version: &quot;3.9&quot;
  services:
    php-apache:
      image: php:7.3-apache
      command:
        - --default-authentication-plugin=mysql_native_password
        - docker-php-ext-install
        - mysqli pdo
        - pdo_mysql
      container_name: php-apache-container
      depends_on:
        - mysql
      restart: always
      volumes:
        - ./api/:/var/www/html/
      ports:
        - 8010:80
      links:
        - mysql
    mysql:
      image: mysql:5.7
      container_name: mysql-container
      restart: always
      environment:
        TZ: &quot;America/New_York&quot;
        MYSQL_ALLOW_EMPTY_PASSWORD: &quot;no&quot;
        MYSQL_ROOT_PASSWORD: root_password
        MYSQL_DATABASE: db_name
        MYSQL_USER: db_user
        MYSQL_PASSWORD: db_password
      volumes:
        - mysql-data:/var/lib/mysql
  volumes:
    mysql-data:
  </code></pre>
  <p>The php-apache-container keeps restarting.
  But if I change this:</p>
  <pre><code>php-apache:
          image: php:7.3-apache
          command:
            - --default-authentication-plugin=mysql_native_password
            - docker-php-ext-install
            - mysqli pdo
            - pdo_mysql
  </code></pre>
  <p>into this:</p>
  <pre><code>php-apache:
      build:
        context: .
        dockerfile: dockerfile
      command: --default-authentication-plugin=mysql_native_password
  </code></pre>
  <p>And the dockerfile have the following content:</p>
  <pre><code>FROM php:7.3-apache
  RUN docker-php-ext-install mysqli pdo pdo_mysql
  </code></pre>
  <p>It works, but I don't want to use a dockerfile, how can I make it work without using the dockerfile?</p>
  <p>Thanks in advance!!!</p>