This repository contains the skeleton setup required to run your x0-application within minutes using a local Docker Environment or Google Kubernetes Engine (GKE).
Warning
This repository is a "template repository." For more details, refer to: Github - Creating A Repository From A Template. You should create your own repository from this template before starting to model your x0-app or making any changes.
The following links should be considered if you are interested in more precise x0-system information and how-to model x0-applications:
- Quick Setup / Examples
- Dependencies / Package Installation
- Docker Permissions
- Clone Repository
- Docker Images
- Build Base Debian Packages
- Build Docker Containers
- IP Setup / DNS
- Start Base Application
- Kubernetes Minikube
To see what the x0-system is capable of, build one of the dockerized examples documented at: ./example/README.md.
Ubuntu 22.04
# install debian package builder / gnu gpg
apt-get -y install debuild gnupg docker.ioUbuntu 24.04 / Devuan
# install debian package builder / gnu gpg
apt-get install devscripts debhelper pbuilder gnupg docker.ioAs the root user, add your current user to the Docker UNIX group:
# add user to docker group
usermod -aG docker your-userNote
A restart of your current shell, desktop session, or even computer may be required for the changes to take effect.
# clone x0-skeleton / your-x0-app-repo
mkdir ~/src && cd ~/src
git clone https://github.com/WEBcodeX1/x0-skeleton.git# pull docker images
docker pull ghcr.io/webcodex1/x0-app
docker pull ghcr.io/webcodex1/x0-db-- or --
Download Docker images manually:
To load the Docker images:
# load docker images
docker load < docker.x0-app.tar
docker load < docker.x0-db.tarInstall the required tools and set up GPG before building Debian packages. See: https://github.com/WEBcodeX1/x0/blob/main/debian/README.md.
Provide the following details for default package signing:
Real Name: Your NameEmail address: [email protected]Comment: YourPosition
# build debian packages
cd ./debian && debuild# build docker containers
cd ./docker && build-app.sh && build-db.shThe following IP setup is used for container addresses and hostnames:
| CONTAINER | IP ADDRESS | DNS / HOSTNAME |
|---|---|---|
| your-app | 172.20.0.10 | x0-skeleton-test.x0.localnet |
| your-db | 172.20.0.20 | mypostgres |
Note
Add 172.20.0.10 / x0-skeleton-test.x0.localnet to your hosts file or
dns zone.
Run the following command to test if everything is working correctly:
# build docker container
cd ./docker && x0-start-containers.shOpen http://x0-skeleton-test.x0.localnet/python/Index.py in your browser.
A Hello World. text should be displayed.
By starting the kubernetes installer (Setup.py) using the unmodified
./config/app-config.json metadata, the following Minikube infrastructure on
Linux will be built.
- 2 x0 Application Pods
- 2 Database (replicating) Pods (Kubegres)
- Ingress LoadBalancing (nginx)
# setup minikube environment
cd ./kubernetes/setup/
python3 ./Setup.pyNote
The IP setup including DNS differs from the Docker setup and must be changed according to the next steps.
# get minikube main ip address
minikube ipReturns the current Minikube ingress IP Address (e.g. 192.168.49.2).
# get minikube ingress
kubectl get ingress -n x0-skeleton-testReturns ingress configuration for the x0-skeleton namespace.
Add the data from column HOST and ADDRESS to /etc/hosts or DNS zone file.
Note
Change IP address if already used in Docker context.
Finally check pod status.
# get pods status
kubectl get pods -n x0-skeleton-testNAME READY STATUS
mypostgres-1-0 1/1 Running
mypostgres-2-0 1/1 Running
your-app-test-db-install 0/1 Completed
your-app-test-deployment-6cb48779f9-cq2sb 1/1 Running
your-app-test-deployment-6cb48779f9-d5sf9 1/1 RunningOpen http://x0-skeleton-test.x0.localnet/python/Index.py in your browser.
A Hello World. text should be displayed.