Skip to content

Instantly share code, notes, and snippets.

@edmondyip
Last active July 27, 2018 09:02
Show Gist options
  • Save edmondyip/cf07cb2e602f9f908df4cc184adec57a to your computer and use it in GitHub Desktop.
Save edmondyip/cf07cb2e602f9f908df4cc184adec57a to your computer and use it in GitHub Desktop.
docker-compose ghost setting
version: '2' # docker-compose 的版本
services: # 以下就是服務,可以同時存放多個服務,運行時會一個個啟動
ghost: # service 的名,你可以改成任何不重覆的名稱
image: ghost:1.24.9-alpine # image 的版本,這裡我用了ghost v1.24.9 的輕量版
container_name: 256pages-blog # container 的名,在 docker 中都會見到這個而不是 service name
restart: always # 如果重新開機會自動重啟
ports: # 把 ghost 的 port 2368 mount 到 8080,8080 可以成其他
- '8080:2368'
volumes: # 因為我本身有舊的 ghost,所以把 content mount 到 ./blog 這位置
- './blog:/var/lib/ghost/content'
environment: # environment 是 image 的設定,依每個 image 會有不同選項,ghost 可以設定 url
- url=https://blog.256pages.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment