🐳 Docker Deployment
Install Docker Environment
docker Quick Deployment
Use the image emlog/emlog:pro-latest-php7.4-apache to quickly start emlog. This image includes the latest version of emlog, Apache service, and necessary extensions, but does not include MySQL. You need to install and create the database separately.
$ docker run --name emlog-pro -p 8080:80 -d emlog/emlog:pro-latest-php7.4-apache
docker-compose Deployment
-
Create a folder anywhere on your system; this document uses
~/emlogas an example.mkdir ~/emlog && cd ~/emlog -
Create
docker-compose.yamlwith the following content:version: '3'
services:
mysql:
image: mysql/mysql-server:5.6
container_name: mysql56
command:
- --default_authentication_plugin=mysql_native_password
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
volumes:
- ./db_data/mysql:/var/lib/mysql
ports:
- "3306:3306"
restart: always
environment:
MYSQL_DATABASE: emlog
MYSQL_USER: emlog
MYSQL_PASSWORD: emlog
networks:
- emlog_network
emlog:
image: emlog/emlog:pro-latest-php7.4-apache
container_name: emlog-pro
restart: always
environment:
- EMLOG_DB_HOST=mysql
- EMLOG_DB_NAME=emlog
- EMLOG_DB_USER=emlog
- EMLOG_DB_PASSWORD=emlog
- EMLOG_DOMAIN_NAME=localhost
- MAX_POST_BODY=50m
- MAX_EXECUTION_TIME=300
ports:
- 80:80
networks:
- emlog_network
volumes:
- ./data:/app
labels:
createdBy: "Apps"
networks:
emlog_network:
external: true -
Create Docker network
docker network create emlog_network -
Start emlog service
docker-compose up -d -
Access the deployed emlog site: http://localhost
Extended Environment Variables
| Variable Name | Description |
|---|---|
| MAX_POST_BODY | Corresponds to PHP upload_max_filesize and post_max_size settings |
| MAX_EXECUTION_TIME | Corresponds to PHP max_execution_time setting |
| EMLOG_DOMAIN_NAME | Site domain name eg: www.emlog.net |