Docker Installation
Leemons can be installed as a containerized app. This is useful for automatizing processes and avoiding the need of installing all the required dependencies on your system.
1. Requirements
Docker and Docker Compose
Docker makes it possible to deploy all the necessary parts for leemons to work, making it fast, easy, and predictable. We use the docker-compose tool for managing the multi-container deployment, so there is less work to do and Leemons can be enjoyed even quicker!
You can install Docker and Docker Compose through the docker website.
2. Download
First of all you need to download leemons on your computer or sever, don't worry, this one is the easier step :D.
- Windows
- Linux and Mac
Using leemons-docker in windows is as easy as run a PowerShell script, this script will generate all the needed files.
Download the file ahead to your desired directory (keep in mind it will generate files).
Download name and directory
We recommend downloading in: /my-docker-leemons/leemons.ps1
Or see the code
$FILE="./docker-compose.yaml"try { $OUTPUT=docker --version echo "Docker is installed"}catch { echo "Please install Docker before continue!" Pause exit 0}try { $OUTPUT=docker-compose --version echo "docker-compose is installed"} catch { echo "Please install docker-compose before continue!" Pause exit 0}if ( Test-Path -Path $FILE -PathType Leaf ) { echo "Config files already created."} else {@"MYSQLDB_USER=rootMYSQLDB_ROOT_PASSWORD=leemonsMYSQLDB_DATABASE=leemonsMYSQLDB_LOCAL_PORT=3307NODE_LOCAL_PORT=8080"@ | Out-File -FilePath ".env" -Encoding ASCII@"version: "3.8"services: mysqldb: image: mysql:5.7 command: --default-authentication-plugin=mysql_native_password restart: always environment: MYSQL_ROOT_PASSWORD: `$MYSQLDB_ROOT_PASSWORD MYSQL_DATABASE: `$MYSQLDB_DATABASE ports: - `$MYSQLDB_LOCAL_PORT:3306 expose: - 3306 volumes: - db:/var/lib/mysql healthcheck: test: mysqladmin ping -h 127.0.0.1 -uroot --password=$`$MYSQL_ROOT_PASSWORD timeout: 10s retries: 10 leemons: image: leemonade/leemons:dev restart: always stdin_open: true tty: true ports: - `$NODE_LOCAL_PORT:8080 environment: DATABASE_HOST: mysqldb DATABASE_PORT: 3306 DATABASE_USERNAME: root DATABASE_DATABASE: `$MYSQLDB_DATABASE DATABASE_PASSWORD: `$MYSQLDB_ROOT_PASSWORD depends_on: mysqldb: condition: service_healthyvolumes: db:"@ | Out-File -FilePath $FILE -Encoding ASCII "docker-compose up" | Out-File -FilePath launch-leemons.ps1 -Encoding ASCII}.("./launch-leemons.ps1")Pause
Now you only need to run the file, this can differ based on your windows version:
- Windows10: Right click the file and select
open with powershell
- Windows11: Right click the file and select
run with powershell
Using leemons-docker is as easy as running a bash script, this script will generate all the needed files, if they are already downloaded, it will directly run leemons.
Download the file ahead to your desired directory (keep in mind it will generate files).
Download name and directory
We recommend downloading in: /my-docker-leemons/leemons.ps1
Or see the code
#!/bin/bashFILE=./docker-compose.yamlif [ -x "$(command -v docker)" ]; then echo "Docker is installed" # commandelse echo "Please install Docker before continue!" exit 0fiif [ -f "$FILE" ]; then echo "Config files already created."else printf "MYSQLDB_USER=rootMYSQLDB_ROOT_PASSWORD=leemonsMYSQLDB_DATABASE=leemonsMYSQLDB_LOCAL_PORT=3307NODE_LOCAL_PORT=8080" >> .env printf "version: \"3.8\"services: mysqldb: image: mysql:5.7 command: --default-authentication-plugin=mysql_native_password restart: always environment: MYSQL_ROOT_PASSWORD: \$MYSQLDB_ROOT_PASSWORD MYSQL_DATABASE: \$MYSQLDB_DATABASE ports: - \$MYSQLDB_LOCAL_PORT:3306 expose: - 3306 volumes: - db:/var/lib/mysql healthcheck: test: mysqladmin ping -h 127.0.0.1 -uroot --password=\$\$MYSQL_ROOT_PASSWORD timeout: 10s retries: 10 leemons: image: leemonade/leemons:dev restart: always stdin_open: true tty: true ports: - \$NODE_LOCAL_PORT:8080 environment: DATABASE_HOST: mysqldb DATABASE_PORT: 3306 DATABASE_USERNAME: root DATABASE_DATABASE: \$MYSQLDB_DATABASE DATABASE_PASSWORD: \$MYSQLDB_ROOT_PASSWORD depends_on: mysqldb: condition: service_healthyvolumes: db:" >> docker-compose.yaml printf "docker-compose up" >> launch-leemons.shfish launch-leemons.sh
Now you only need to run the file, this can differ based on your operating system:
- Firstly, you need to open the terminal.
- Now navigate to your desired folder:
cd /my-docker-leemons
- Check that the file exists:
ls leemons.sh
, it should print the file name, otherwise, review the path - Finally, run the script with
sh leemons.sh
tip
Some operating systems let you drag and drop the folder to your terminal to paste the path, you can type cd
and drag and drop it to complete the command.
Once running, it will start downloading some files and docker stuff (it may take a few minutes), once ready, you should see something like this:
When the server is ready, open a new tab in your browser, and navigate to http://localhost:8080
3. Bulk data creation template configuration
NOT SUPPORTED YET
Currently the bulk templates are not yet supported for docker
4. Initial configuration
The first run you will need to set up some things, follow the steps and enter your information.
Once you get to the email provider, we recommend using a free smtp server, or if you have one, go and try it.
tip
We recommend using this free smtp server, we have tried it and works like a charm.
5. Database
Leemons docker uses a MySQL server internally, which is configured through the .env file in your directory
6. Reset the installation
In order to reset your Leemons installation, you need to clean your docker images, this can be done with the following command inside your my-docker-leemons
directory:
docker-compose down;
docker rmi --force $(docker images leemonade/leemons -q);