Skip to main content

Deploy own docker-compose image using Elestio Custom docker-compose

This tutorial walks you through deploying your own custom Docker image to the Elestio cloud.

Use cases:

  • Deploy one or multiple instances of stateful apps like WordPress / Directus / MySQL / Redis / RabbitMQ / ...
  • Deploy an internal service available only to your private network
  • Deploy an application that was created elsewhere and published to a private Docker registry

To learn more about Elestio CI/CD, see CI/CD Pipelines.

If you're new, sign up for Elestio; otherwise, log in to your existing account.

Deploy a custom docker-compose image with the Custom docker-compose template​

Step 1:​

Go to CI/CD from the left sidebar.

Step 2:​

Select Docker compose as the deployment source.

Selecting Docker compose as the deployment source

Step 3:​

Here you can see Elestio templates for the most popular tech stacks.

Elestio templates

To deploy your own Docker images, select the Custom docker-compose template. To deploy one of the Elestio example templates instead, select the template you want and follow the same steps.

Custom docker-compose template

Click the Deploy button to proceed.

Step 4:​

Choose the deployment target.

Choosing the deployment target

Elestio offers two types of deployment targets: Deploy on a new VM and Deploy on an existing VM.

You can set up several pipelines on each Elestio CI/CD target (VM). How many depends on the project configuration you select and on the project you're deploying.

If you want to deploy the project as a pipeline on a new target, or don't have any installed targets yet, choose Deploy on a new VM. If you already have installed or previously configured CI/CD targets, choose Deploy on an existing VM, then choose the existing target from the targets dropdown.

Follow the steps below only if you select Deploy on a new VM; otherwise, click Next to proceed.

CI/CD Pipelines by Elestio are available with our cloud partners (AWS Lightsail, Digital Ocean, Vultr, Linode, Hetzner & OVHcloud) in 100+ locations, but also on any cloud (AWS, Azure, Google, Oracle, ...) and on-premise with BYOVM.

  1. Select the service cloud provider.

    Selecting the service cloud provider

  2. Select the service cloud region.

    Selecting the service cloud region

  3. Select the service plan.

    Selecting the service plan

  4. Customize the target name and the project where the CI/CD target will be created.

    Customizing the target name and project

By default, the target gets a generated name and is created in the current project. You can change both.

Step 5:​

Configure your project's Docker image and other details.

Docker compose editor and private registry option

Enter your docker-compose.yaml. If your images are in a private registry, check Use a private Docker registry to configure the registry credentials.

docker-compose.yaml of the Redis example

Configure your own Docker images the same way. In this example, the configuration deploys Redis and RedisInsight.

Keep your volumes inside the pipeline folder

Declare every volume with a relative path, such as ./data:/data in the example above. Docker Compose then stores the data inside the pipeline folder (/opt/app/<pipeline-name>/data), which is included in the pipeline backups.

Do not map volumes to a folder outside the pipeline, such as /root/data:/data or /data:/data: data stored there is not included in the backups.

Environment variables of the Redis example

List your project's API keys, secrets and other settings as environment variables (.env).

Reverse proxy configuration

The final step is to configure the reverse proxy settings: specify the ports your project listens on, and which of them are exposed publicly.

Pipeline name

Elestio fills in the pipeline name automatically. You can change it now, but not after the pipeline is created.

Step 6:​

Click the Create CI/CD pipeline button to deploy your pipeline.

Create CI/CD pipeline

In a couple of moments, your application is deployed on Elestio.

If you run into any problem, contact our support by email or through the ticketing system. Join us on Discord to learn more.