Home

Awesome

Demo online Ghost version GitHub issues GitHub forks GitHub stars GitHub followers Twitter XergioAleX

Ghost docker configuration using nginx

Docker infrastructure

Docker

Prerequisitos

Download && install docker

Download && install docker compose

Happy path for production in local machine environment

Just run:

cd docker/production
# without ssl
bash docker.sh up
# with ssl
bash docker.sh up secure

The docker configuration is explained in detail below.

Script bash and env vars

Go from console to the docker/production folder:

cd docker/production

In docker/production there is a bash script in the docker.sh file that can be run like this:

./docker.sh parameters
# Or
bash docker.sh parameters  // If you have a different bash shell like oh my zsh

There are serveral files with environment variables or config files to consider:

Files with environment variables .env and other config files mentioned below are ignored and will be created automatically from the *.example files.

Commands

Notes:

The following describes each of the parameters::

Usage: docker.sh [up|start|restart|stop|rm|sh|bash|logs|ps]

Using Multi Sites Config

Followup similar steps for one site using the folder:

Create database for second site:

To create a new database with a new user in MySQL, you can follow these steps:

  1. Log in to MySQL as the root user: mysql -u root -p
  2. Enter your root password when prompted.
  3. Create a new database: CREATE DATABASE dbname;
  4. Create a new user: CREATE USER 'username'@'%' IDENTIFIED BY 'password';
  5. Grant privileges to the new user for the new database: GRANT ALL PRIVILEGES ON dbname.* TO 'username'@'%';
  6. Flush the privileges to apply the changes: FLUSH PRIVILEGES; Replace "dbname" with the name of your new database, "username" with the name of your new user, and "password" with a secure password for your new user. Once you have completed these steps, you should be able to log in to MySQL using your new user credentials and access your new database.