LogoLogo
Run to Console
  • ClawCloud Run
    • Document
    • Getting Started
      • Create a DevBox
      • Deploy Database
      • Deploy from Docker
      • Deploy from Template
    • Guide
      • App Launchpad
        • Install Application
        • Update Application
        • Custom Domain
        • Exposing Multiple Ports
        • Environment Variables
        • Configuration Files
        • Auto Scaling
        • Persistent Storage
        • Custom Domain Certificates
      • Devbox
        • Devbox List
        • Devbox Details
        • Devbox Release
      • Database
        • PostgreSQL
        • MySQL
        • Redis
        • MongoDB
        • Kafka
        • Milvus
      • Object Storage
      • Advanced
        • Workspace
        • Terminal
        • Cron Job
        • KubeConfig
    • Pricing
    • Billing & Usage
    • Migration
      • Migrate from Docker
      • Migrate from Docker Compose
    • Architecture
      • Devbox Architecture
      • System Architecture
      • User Architecture
    • Legal
      • Privacy Policy
      • Terms and Conditions
      • Data Processing Addendum
    • Changelog
    • Best Practice
    • FAQ
    • More
      • Abuse Complaint
    • Help
  • Blog
Powered by GitBook

Copyright @ 2023-Present CLAWCLOUD. All Rights Reserved.

On this page

Was this helpful?

Export as PDF
  1. ClawCloud Run
  2. Migration

Migrate from Docker Compose

PreviousMigrate from DockerNextArchitecture

Last updated 2 months ago

Was this helpful?

This part explains how to migrate applications from Docker Compose to the Clawcloud Run platform.

Clawcloud Run offers features such as instant deployment, deep CI/CD integration, private networks, observability, and elastic scaling, allowing developers to focus on implementing business logic without worrying about the underlying infrastructure. Thanks to the user-friendly experience provided by the Clawcloud Run platform, developers can more easily migrate, deploy, and manage applications.

This part uses Wordpess with a MySQL database as an example to demonstrate how to migrate applications from Docker Compose to the Clawcloud Run platform.

Background Information

What is Docker Compose?

Docker Compose is a tool for defining and running multi-container applications. It is the key to unlocking a streamlined and efficient development and deployment experience.

Compose simplifies the control of your entire application stack, making it easy to manage services, networks, and volumes in a single, comprehensible YAML configuration file. Then, with a single command, you create and start all the services from your configuration file.

The Docker Compose configuration file is as follows:

docker-compose.yml
services:

  wordpress:
    image: wordpress
    restart: always
    ports:
      - 8080:80
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_USER: exampleuser
      WORDPRESS_DB_PASSWORD: examplepass
      WORDPRESS_DB_NAME: exampledb
    volumes:
      - wordpress:/var/www/html

  db:
    image: mysql:8.0
    restart: always
    environment:
      MYSQL_DATABASE: exampledb
      MYSQL_USER: exampleuser
      MYSQL_PASSWORD: examplepass
      MYSQL_RANDOM_ROOT_PASSWORD: '1'
    volumes:
      - db:/var/lib/mysql

volumes:
  wordpress:
  db:

primarily involving the following parameters:

  • ports: publish a container's port(s) to the host;

  • environment: set environment variables;

  • volumes: bind mount a volume.

Next, we will demonstrate how to deploy an identical application on the Clawcloud Run platform using the same image, database and configuration parameters.

Deployment Steps

Log in to the Clawcloud Run console, navigate to the App Launchpad application, and click on "Create APP".

On the Application Deployment page, fill in the application parameters as specified in the table below:

Application Parameter
Parameter Value
Description

Application Name

Wordpress with MySQL

Custom Application Name

Image Type

Public

Public or Private

Image Name

wordpress:latest

Format <User-name>/<Image-name>:tag

Usage Type

Fixed

Fixed or Scaling

Replicas

1

Set according to actual needs

CPU

2 Core

Set according to actual needs

Memory

4 G

Set according to actual needs

Next, configure the application parameters corresponding to the -p, -e, and -v options in the docker run command.

Docker Parameters
Application Parameter
Parameter Value

8080:80

Network - Container Port

80

WORDPRESS_DB_HOST: db

WORDPRESS_DB_USER: exampleuser

WORDPRESS_DB_PASSWORD: examplepass

WORDPRESS_DB_NAME: exampledb

Advanced Configuration - Environment Variables

WORDPRESS_DB_HOST: db

WORDPRESS_DB_USER: exampleuser

WORDPRESS_DB_PASSWORD: examplepass

WORDPRESS_DB_NAME: exampledb

wordpress:/var/www/html

Advanced Configuration - Local Storage

/var/www/html

Finally, click "Deploy Application" to deploy the application.

Next, create the MySQL database, navigate to the Database application, and click on "Create Database".

On the Database Deploy page, fill in the database parameters as specified in the table below:

Database Parameter

Parameter Value

Description

Type

MySQL

MySQL or PostgreSQL or Redis etc.

Version

mysql-8.0.30

Database version

Name

db

Custom Database Name

CPU

2 Core

Set according to actual needs

Memory

4 G

Set according to actual needs

Replicas

3

Set according to actual needs

Storage

100 G

Set according to actual needs

Backup

Off

Set according to actual needs

Finally, click "Deploy" to deploy the database.

Record the database connection details displayed in the console, such as Username, Password, Host, etc.

Go back to the App Launchpad, edit the Environment Variables for WordPress, input the database connection information, and restart the WordPress application.

You can now access Wordpress via the Public Address provided by the Clawcloud Run platform.

You can also use a custom domain to access the application. To set up a custom domain, please add a CNAME record for your domain pointing to the public address at your domain registrar. You can bind your custom domain once the DNS resolution takes effect.

Worpress
Clawcloud Run Console
App Launchpad
Deploy Application
Clawcloud Run Database
Create Database
Deploy Database
Database Connection Details
Edit Environment Variables
Wordpress Initialization interface
Custom Domain