Translate docker compose to render.yml

Really lost on how to do this guys; i feel like the blueprints docs maybe are running a little short. any help is appreciated

version: '3.8'
services:
  nginx-svc:
      build:
        context: .
        dockerfile: ./.docker-files/nginx/Dockerfile
      ports:
          - 80:80
      volumes:
          - ./web:/var/www/html/web
      depends_on:
        - php-svc

  php-svc:
      build:
        context: .
        dockerfile: ./.docker-files/php/Dockerfile
      expose:
        - 9000
      volumes:
          - ./config:/var/www/html/config
          - ./templates:/var/www/html/templates
          - ./storage:/var/www/html/storage
          - ./modules:/var/www/html/modules
          - ./web:/var/www/html/web
          - ./composer.json:/var/www/html/composer.json
      environment:
        ENVIRONMENT: $ENVIRONMENT
        DB_DRIVER: $DB_DRIVER
        DB_SERVER: $DB_SERVER
        DB_PORT: $DB_PORT
        DB_DATABASE: $DB_DATABASE
        DB_USER: $DB_USER
        DB_PASSWORD: $DB_PASSWORD
        DB_SCHEMA: $DB_SCHEMA
        DB_TABLE_PREFIX: $DB_TABLE_PREFIX
        SITE_URL: $SITE_URL
        SECURITY_KEY: $SECURITY_KEY

  mysql-svc:
      image: mysql:8.0
      volumes:
          - db-data-cityar-craftcms:/var/lib/mysql
      ports:
          - 3306:3306
      environment:
          MYSQL_ROOT_HOST: '%'
          MYSQL_ROOT_PASSWORD: $DB_ROOTPASSWORD
          MYSQL_DATABASE: $DB_DATABASE
          MYSQL_USER: $DB_USER
          MYSQL_PASSWORD: $DB_PASSWORD
      command: mysqld --default-authentication-plugin=mysql_native_password
      healthcheck:
        test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
        timeout: 45s
        interval: 10s
        retries: 10

  phpmyadmin-svc:
      image: phpmyadmin/phpmyadmin
      ports:
          - 8085:80
      environment:
          PMA_HOST: mysql-svc

volumes:
  db-data-cityar-craftcms:

Hi there,

Thanks for reaching out.

Render doesn’t currently support Docker compose files, however, there is a feature request if you want to upvote/comment on that: https://feedback.render.com/features/p/support-docker-compose.

Have you tried creating a Blueprint? Do you have any specific issues?

It may also depend on how you want to architect your project. While our guides likely won’t fit your requirements exactly, they may be worth a look to see working examples. Your compose file above has nginx and PHP containers separated, our Laravel example uses a combined PHP/Nginx image which may provide a little simpler set up. And our Wordpress example blueprint shows how to set up a Docker service along with a MySQL service.

It looks like you need:

Guides that may be worth reading over:

Please let us know if you have any more questions.

Alan

Hi Alan. Can the MySQL DB be deployed on a public web service instead of a private one? I need it to be accessible from external clients. Thanks

No, not currently. Only HTTP services (Web Services) are accessible externally. However, there is a feature request for non-http access here: https://feedback.render.com/features/p/allow-connecting-to-non-http-services-from-outside-render. Feel free to upvote/comment to be notified of any updates.

Alan

so, basically, there is no way to deploy a publicly available DB, other than postgresql, in render?

At this time, correct.

Alan

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.