Docker - install ghost & mariadb
-
Step 1 : install docker's containerd
Step 2 : create folders where to store the related ghost files
mkdir -p /docker/ghost/mariadb_data mkdir -p /docker/ghost/ghost
Step 3 : create docker-compose.yml
cd /docker/ghost vim docker-compose.yml
File: docker-compose.yml
Replace 2 variables;
- MYSQL_GHOST_PASSWORD_HERE
- MYSQL_ROOT_PASSWORD_HERE
version: '3.3' services: mariadb: image: mariadb:latest environment: MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD_HERE} MYSQL_USER: ghost MYSQL_PASSWORD: ${MYSQL_GHOST_PASSWORD_HERE} MYSQL_DATABASE: ghost_production restart: always volumes: - type: bind source: /docker/ghost/mariadb_data target: /var/lib/mysql ghost: image: ghost:latest environment: url: https://ghost.aizu.my database__client: mysql database__connection__host: mariadb database__connection__database: ghost_production database__connection__user: ghost database__connection__password: ${MYSQL_ROOT_PASSWORD_HERE} depends_on: - mariadb ports: - 10001:2368 restart: always volumes: - type: bind source: /docker/ghost/ghost target: /var/lib/ghost/content
Step 4 : run
docker-compose up -d
Service will be available at port 10001.
curl localhost:10001
-
-