Many applications provide a docker-compose.yml file. Instead of typing in all the details by hand, let the customer area read the file for you. You can find the template in two places:
- in the Create container wizard, in step 2 Configure (Creating a container)
- in the settings of an existing container
Template from the image’s repository
If there is a docker-compose file in the repository of the selected image, the customer area automatically searches for it and displays: ‘There is a … in the repository … for this image.’ Click View template to use it.
Upload or paste your own file
- Click Upload file and select your
docker-compose.yml- or click Paste content and paste the content. - Click Read.
- If the file contains multiple services, select the service that belongs to this container.
- Check the preview and click Apply.
The file is only read, not stored. It must not exceed 64 KB in size.
What is imported
- Variables from
environmentwith their values - passwords are never pre-filled with a sample value. - Volumes - named volumes are created as new volumes. Folders from the host are created as empty volumes.
- Start command from
command. - Ports - if a port is suitable for a web address, the customer area will suggest it. Other containers access the ports via the container name anyway.
What you need to add yourself
The yellow box below the preview lists everything that was not imported:
- Sample passwords - variables such as
WORDPRESS_DB_PASSWORDare set to ‘please set yourself’. - Additional services - each container runs exactly one service. Set up any additional services, such as the database, as separate containers within the same network.
- Variables from files (
env_file) - these files are not read. - Port ranges and access to the host, such as mounted system folders, as well as settings that are not possible on the platform.
- Custom-built services - if a service is built from source code, the template may not match the selected image exactly.
Always set your own passwords
Sample values from templates are publicly known. That is why we deliberately do not carry them over. Please assign a unique, long password to each password variable and make sure it is marked as Secret.
Adjust container names
In docker-compose, services reach each other via their service name, for example db. In Container Hosting, it is the name of your container. If your database container is called mariadb, set WORDPRESS_DB_HOST to mariadb.
In the settings, only effective after ‘Save’
If you apply a template in the settings of an existing container, it only fills in the form at first. It takes effect when you click Save - the container is then recreated.