migrate ghost from sqlite to mysql 8

This commit is contained in:
2026-04-25 23:57:13 +00:00
parent c449a2ce3e
commit 139ccb3f0c
2 changed files with 42 additions and 5 deletions
+4 -1
View File
@@ -1,7 +1,10 @@
URL=
MAIL_HOST= MAIL_HOST=
MAIL_PORT=465 MAIL_PORT=465
MAIL_SECURE=true MAIL_SECURE=true
MAIL_USERNAME= MAIL_USERNAME=
MAIL_PASSWORD= MAIL_PASSWORD=
MAIL_FROM= MAIL_FROM=
DATABASE_ROOT_PASSWORD=
DATABASE_USER=ghost
DATABASE_PASSWORD=
+38 -4
View File
@@ -1,4 +1,6 @@
networks: networks:
ghost:
external: false
caddy: caddy:
name: caddy name: caddy
driver: bridge driver: bridge
@@ -12,11 +14,15 @@ services:
labels: labels:
- "com.centurylinklabs.watchtower.enable=true" - "com.centurylinklabs.watchtower.enable=true"
networks: networks:
- ghost
- caddy - caddy
environment: environment:
# DB # DB (MySQL)
database__client: sqlite3 database__client: mysql
database__connection__filename: content/data/ghost.db database__connection__host: db
database__connection__user: ${DATABASE_USER}
database__connection__password: ${DATABASE_PASSWORD}
database__connection__database: ghost
# App # App
NODE_ENV: production NODE_ENV: production
url: https://aykhans.me url: https://aykhans.me
@@ -31,9 +37,37 @@ services:
mail__options__service: SMTP mail__options__service: SMTP
mail__transport: SMTP mail__transport: SMTP
volumes: volumes:
- ./data:/var/lib/ghost/content - ./data/ghost:/var/lib/ghost/content
depends_on:
db:
condition: service_healthy
logging: logging:
driver: "json-file" driver: "json-file"
options: options:
max-size: "100m" max-size: "100m"
max-file: "3" max-file: "3"
db:
image: mysql:8.0.44
container_name: ghost-db
restart: unless-stopped
networks:
- ghost
environment:
MYSQL_ROOT_PASSWORD: ${DATABASE_ROOT_PASSWORD}
MYSQL_USER: ${DATABASE_USER}
MYSQL_PASSWORD: ${DATABASE_PASSWORD}
MYSQL_DATABASE: ghost
volumes:
- ./data/mysql:/var/lib/mysql
healthcheck:
test:
["CMD-SHELL", "mysqladmin ping -p$$MYSQL_ROOT_PASSWORD -h 127.0.0.1"]
interval: 5s
start_period: 30s
retries: 30
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"