title: How to configure mariadb docker-compose file to use other port than 3306?
body: <p>I cannot get mariadb to use another port other than 3306 when running it in a docker container using a docker-compose file.</p>
  
  <p>I have already read the mariadb/docker documentation, searched online and conducted my own experiments.</p>
  
  <ol>
  <li>docker-compose file:</li>
  </ol>
  
  <pre><code>version: '3.1'
  
  services:
  
    db:
      image: mariadb
      restart: always
      environment:
      - MYSQL_ROOT_PASSWORD=mypassword
      - MYSQL_TCP_PORT=33030
      - MYSQL_UNIX_PORT=33020
      ports:
      - "33020:33020"
  </code></pre>
  
  <ol start="2">
  <li>Dockerfile:</li>
  </ol>
  
  <pre><code>FROM: mariadb: 10.3.14
  COPY mydbscript.sql /docker-entrypoint-initdb.d/
  EXPOSE 33020
  CMD ["mysqld"]
  </code></pre>
  
  <p>It never uses port 33020. It still uses port 3306. How can I pass the port dynamically via the docker-compose file at run-time?</p>