Skip to content

pereira-tech-talks/ghostDocker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Ghost docker configuration using nginx and certbot

Docker infrastructure

Docker

Prerequisitos

Download && install docker

Download && install docker-compose

Download && install docker-machine

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

Happy path for production remote machine environment

Just run:

cd docker/production
# without ssl
bash docker.machine.sh up
# with ssl
bash docker.machine.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:

  • docker/production/.env # Environment variables needed to run the bash script
  • docker/production/ghost/.env # Ghost service environment variables
  • docker/production/mysql/.env # Mysql service environment variables
  • docker/production/nginx/.env # Nginx service environment variables
  • docker/production/nginx/site.template # Nginx config site without ssl
  • docker/production/nginx/site.template.ssl # Nginx config site with ssl

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

Commands

Notes:

  • Params between {} are optional, except {}*.
  • Service names available: Service names: ghost | mysql | nginx | cerbot

The following describes each of the parameters::

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

  • deploy --> Build and run services.
  • server.up {secure} --> Build and run server (nginx) services; "secure" parameter is optional for ssl configuration
  • up {secure} --> Build && deploy services; "secure" parameter is optional for ssl configuration.
  • start {service} --> Start services.
  • restart {service} --> Restart services.
  • stop {service} --> Stop services.
  • rm {service} --> Remove services.
  • sh {service}* --> Connect to "service" shell.
  • bash {service}* --> Connect to "service" bash shell
  • logs {service}* {n_last_lines} --> Show "service" server logs
  • machine.[details|create|start|restart|stop|rm|ip|ssh] --> Machine actions

About

Pereira Tech Talks - Ghost Blog Configuration

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 98.1%
  • Dockerfile 1.9%