Created
August 28, 2017 01:20
-
-
Save agc93/b9984b8a3e552632447d60bae16fb6d7 to your computer and use it in GitHub Desktop.
Running a Ghost blog with MariaDB behind nginx with Docker Compose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '2' | |
| services: | |
| proxy: | |
| image: jwilder/nginx-proxy | |
| container_name: nginx-proxy | |
| ports: | |
| - '80:80' | |
| - '443:443' | |
| volumes: | |
| - /var/run/docker.sock:/tmp/docker.sock:ro | |
| - /etc/nginx/vhost.d # to update vhost configuration | |
| - /usr/share/nginx/html # to write challenge files | |
| - /apps/web/ssl:/etc/nginx/certs:ro # update this to change cert location | |
| ssl-companion: | |
| image: jrcs/letsencrypt-nginx-proxy-companion | |
| container_name: ssl-companion | |
| volumes: | |
| - /apps/web/ssl:/etc/nginx/certs:rw # same path as above, now RW | |
| volumes_from: | |
| - proxy | |
| depends_on: | |
| - proxy | |
| mariadb: | |
| image: 'bitnami/mariadb:latest' | |
| volumes: | |
| - 'mariadb_data:/bitnami/mariadb' | |
| blog: | |
| image: 'bitnami/ghost:latest' | |
| expose: | |
| - '2368' | |
| depends_on: | |
| - mariadb | |
| environment: | |
| - VIRTUAL_HOST=your.blog.com | |
| - LETSENCRYPT_HOST=your.blog.com | |
| - [email protected] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@l50 it's usually better to use
restart: unless-stoppedinstead ofrestart: alwaysThis will restart the container on a reboot or power failure, but will not automatically restart it if stopped manually.