Build and run Mendix applications in Container

​Mendix developed applications have a variety of operating methods

  1. Inside the local development tool (suitable for team debugging)

  2. Cloud server (suitable for production environment)

  3. Container (between local and cloud)

Let's introduce the last mode of operation.

table of Contents:

  • Package the Mendix application

  • Docker operating environment

  • Build the Mendix application running environment

  • Run and debug


One, package the Mendix application

 Export local Mendix Modeler tool developed Mendix App, there Liang ways can be packaged:

  • Click File, Export Project Package in sequence on the Modeler client;

  • Click Project, Create Deployment Package in sequence on the Modeler client;

Note that the suffixes of the two packages are different, one is mda and the other is mpk, both can be used, and the difference between the two will be discussed later.

The SecurityLevel of the Project needs to be set before packaging. Select the Production environment.

 

Two, Docker operating environment

Mendix program operating environment restrictions:

  • Centos7.3 and above, update to the latest kernel version.

  • Install the latest version of Docker and Docker comppose.

1. Check your current kernel version through the uname -r command

uname -r

2. Log in to Centos with root privileges. Ensure that the yum package is updated to the latest.

yum update

3. Uninstall the old version

yum remove docker docker-client  docker-common docker-selinux docker-engine

4. Install the required software packages, yum-util provides the yum-config-manager function, and the other two are dependent on the devicemapper driver

yum install -y yum-utils device-mapper-persistent-data lvm2

5. Set yum source

yum-config-manager     --add-repo https://download.docker.com/linux/centos/docker-ce.repo

6. You can view all docker versions in all warehouses and select a specific version to install

​ yum list docker-ce --showduplicates | sort -r

 

7. Install docker

yum install docker-ce

8. Start and add boot to start

systemctl start docker systemctl enable docker

9.Verify whether the installation is successful (there are two parts, client and service, indicating that the docker installation and startup are successful)

docker version

Install DockerCompose

1. Install python-pip

yum install  python-pip

2. Install docker-compose

pip install docker-compose

3. Verify that the installation is successful

docker-compose   version

 

Three, build the Mendix application operating environment

Mendix runs in docker. For its open source environment, please see:

https://github.com/mendix/docker-mendix-buildpack

 

 

1. Upload the previous Mendix application to the Linux server

mkdir   -p  /usr/local/mendix
  • Upload SurveyBuilder.mpk or SurveyBuilder.mda to the folder /usr/local/mendix, SurveyBuilder is your application name, you can modify it freely.

2. Download Docker-Mendix-Buildpack

cd  /usr/local/mendixgit clone https://github.com/mendix/docker-mendix-buildpack cd docker-mendix-buildpack

3. Modify the content of the Makefile file and replace the content with the one shown in the figure below.

Fourth, run and debug

make get-samplemake build-imagemake run-container

Browser view:

http://ip:8080

Can be successfully accessed!


For more information, please visit the following link:

Mendix official website: https://www.mendix.com/zh/

Mendix industry solutions: https://solutions.mendix.com/

Mendix platform guide: https://www.mendix.com/evaluation-guide/

Mendix animation display: https://www.mendix.com/demos/

Mendix public account

 

thanks for reading!

Guess you like

Origin blog.csdn.net/Mendix/article/details/114306002