-refactor file names .yml

-update gitignore for all .env
-segment docker-compose.ymls in folders for each app instead of one mega .yml
This commit is contained in:
gregory hendrickson
2023-10-31 10:56:05 -07:00
parent 47b19d5e33
commit 4b0279c689
14 changed files with 175 additions and 351 deletions

View File

@@ -0,0 +1,46 @@
version: '3'
services:
# MySQL service for Ghost
mysql-ghost:
image: mysql:latest
restart: always
environment:
MYSQL_ROOT_PASSWORD: ${GHOST_DB_ROOT_PASSWORD} # Set MySQL root password
MYSQL_DATABASE: ${GHOST_DB_NAME} # Set Ghost database name
MYSQL_USER: ${GHOST_DB_USER} # Set Ghost database user
MYSQL_PASSWORD: ${GHOST_DB_PASSWORD} # Set Ghost database password
volumes:
- /opt/storagemysql-ghost:/var/lib/mysql # Mount MySQL data directory
hostname: mysql-ghost # Set hostname for MySQL container
networks:
- traefik # Use external network named "traefik"
# Ghost service
ghost:
image: ghost:latest
restart: always
environment:
url: ${GHOST_URL} # Set Ghost URL
database__client: mysql # Set Ghost database client
database__connection__host: mysql-ghost # Set MySQL host for Ghost
database__connection__user: ${GHOST_DB_USER} # Set Ghost database user
database__connection__password: ${GHOST_DB_PASSWORD} # Set Ghost database password
database__connection__database: ${GHOST_DB_NAME} # Set Ghost database name
volumes:
- opt/storageghost/content:/var/lib/ghost/content # Mount Ghost content directory
labels:
- "traefik.enable=true" # Enable Traefik for this service
- "traefik.http.routers.ghost.rule=Host(`${GHOST_DOMAIN}`)" # Route Ghost to specified host
- "traefik.http.routers.ghost.entrypoints=websecure" # Use HTTPS entrypoint for Ghost
- "traefik.http.routers.ghost.tls=true" # Enable TLS for Ghost
- "traefik.http.routers.ghost.tls.certresolver=myresolver" # Use Let's Encrypt resolver for Ghost
- "traefik.http.services.ghost.loadbalancer.server.port=2368" # Set load balancer port for Ghost
- "traefik.http.routers.ghost.middlewares=redirect-to-https@docker" # Use redirect middleware for Ghost
networks:
- traefik # Use external network named "traefik"
#This specifies external network traefik - docker network create traefik is required (managed outside of docker-compose)
networks:
traefik:
external: true # Use external network named "traefik"

View File

@@ -0,0 +1,7 @@
# Ghost configuration
GHOST_DOMAIN=blog.example.com
GHOST_DB_ROOT_PASSWORD=ghost_mysql
GHOST_DB_NAME=ghost_db
GHOST_DB_USER=ghost_user
GHOST_DB_PASSWORD=ghost_mysql
GHOST_URL=https://blog.example.com