Building Docker Images and Deployment file with LDL
This guide will walk you through the process of building and pushing a Docker image, and then creating a deployment file using Lagrange Definition Language (LDL) to deploy your application on the Swan Chain network.
Background
When you deploy your application to SwanChain using the Swan SDK, you need to upload a project with a Dockerfile or a deploy.yaml to GitHub. This article describes how to create a project with a Dockerfile or a deploy.yaml file and upload it to GitHub.
Key Concepts
A
Dockerfile
is a text document containing commands to assemble a Docker image.A
deploy.yaml
file, written in Lagrange Definition Language (LDL), specifies deployment details for your Applications. This gives you more flexibility to add multiple dependent services and more configurations to your application
Building and Pushing Your Docker Image
Download the template: Download the docker-application-template
Navigate to the app folder:
Modify the application code: Edit the
main.py
file.
For example:
Push your code to GitHub
You’re now ready to use your repo URL and the Swan SDK to deploy your first application!
If you believe the Dockerfile alone cannot meet your complex deployment requirements, the next steps will guide you in preparing and creating a deploy.yaml file yourself.
Build the Docker image: Navigate to the root folder and run:
Push to container registry:
Creating Deployment Files with LDL
Create a new project folder:
Create the deploy.yaml file:
Create a deploy.yaml
file in the root of the folder with the following content:
Note: Replace <username>/<repo>:<tag>
with your Docker image information.
Push the LDL project to GitHub
Next Steps
With your Docker image built and pushed, and your LDL deployment file created, you're now ready to deploy your application on the Swan Chain network using Swan SDK. Refer to the Swan SDK documentation for the next steps in the deployment process.
For more information on customizing your deployment settings with LDL, check out the LDL documentation.
Last updated