aizu's Knowledge Base
    • Go to: aizu.my Homepage
    • Recent
    • Tags
    • Register
    • Login

    Docker - install ghost & mariadb

    Linux
    1
    1
    72
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      aizu
      last edited by aizu

      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;

      1. MYSQL_GHOST_PASSWORD_HERE
      2. 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
      

      Ref: https://medium.com/@mehdi.yedes/how-i-run-my-ghost-blog-with-nginx-and-mariadb-on-docker-76da3b0c59a9

      1 Reply Last reply Reply Quote 0
      • A aizu moved this topic from Inbox on
      • A aizu moved this topic from Ref on
      • First post
        Last post