Skip to content

Some documents and scripts for deployment, integration and configuration of Yelda

Notifications You must be signed in to change notification settings

TheYelda/Deployment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

How to deploy

使用Docker-Compose进行一键部署,所用镜像托管在DockerHubdaoCloud上。

Download

clone该仓库:

$ git clone https://github.com/TheYelda/Deployment.git

Installation

  • Docker安装(Mac/Windows需要注册DockerHub账号):
  • Docker-Compose安装
    • Linux
    • Windows/Mac已经集成在Docker中

Configure

  1. 配置Nginx转发:

    ./conf.d/yelda.conf的第2行中,使用本机IP替代127.0.0.1

    set $myhost x.x.x.x;
  2. 配置后端程序:

    ./instance/config.py中,修改配置

    • 使用本机IP替代127.0.0.1

      DB_HOST = 'x.x.x.x'
    • 创建目录,分别存放用户头像和医学影像图片,在配置文件的PHOTOS_FOLDER MEDICAL_IMAGES_FOLDER 中配置。

      PHOTOS_FOLDER = 'yelda/photos'
      MEDICAL_IMAGES_FOLDER = 'yelda/medical-images'
    • 配置会话管理密钥(可选):

      修改instance/config.pySECRET_KEY 字段即可。

    • 配置初始管理员账号密码:

      配置ADMIN_USERNAMEADMIN_PASSWORD 字段。

Run

一键构建和启动容器:

$ sudo docker-compose up

如果出现报错,一般是因为完全启动顺序导致的连接问题。

首先,Ctrl+c终止之前运行的容器。建议在首次启动时,分别执行以下步骤:

  1. 构建容器

    $ sudo docker-compose build
  2. 启动数据库容器

    $ sudo docker-compose up -d db
  3. 启动其它容器

    $ sudo docker-compose up

此时,可以再浏览器中输入localhost:8080访问网站。

之后,可以直接一键启动:

$ sudo docker-compose up -d

-d指定了容器在后台运行。

需要终止容器时:

$ sudo docker-compose down

About

Some documents and scripts for deployment, integration and configuration of Yelda

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages