1.安装docker
2.编写docker-compose.yml
version: "3"
services:
database:
image: postgres:11.6-alpine
environment:
- POSTGRES_USER=codimd
- POSTGRES_PASSWORD=change_password
- POSTGRES_DB=codimd
volumes:
- "database-data:/var/lib/postgresql/data"
restart: always
codimd:
image: hackmdio/hackmd:2.4.1
environment:
- CMD_DB_URL=postgres://codimd:change_password@database/codimd
- CMD_USECDN=false
depends_on:
- database
ports:
- "3000:3000"
volumes:
- upload-data:/home/hackmd/app/public/uploads
restart: always
volumes:
database-data: {}
upload-data: {}
3.进入docker-compose.yml所在目录,执行命令
docker-compose up -d
4.在云服务器上放行3000端口 5.完成,访问http://server_ip:3000,即可使用,
文章来源地址https://www.toymoban.com/news/detail-648518.html
文章来源:https://www.toymoban.com/news/detail-648518.html
到了这里,关于docker搭建在线Markdown服务器的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!