测试用例管理系统TestKiss部署过程记录

it不难
2022-11-01 / 0 评论 / 11 阅读 / 正在检测是否收录...

前言

项目地址

TestKiss

配置过程

修改config.py配置

  SERVER_URL = 'http://外网IP:8080'
  MONGO_URI = "mongodb"

初次运行mongodb启动和初始化

docker exec -it testkiss_python_1 bash
python init_mongo.py  mongodb

基于docker部署

docker-compose.yml

version: "3"
networks:
  tnet:
services:
  python:
    build:
      context: .
      dockerfile: ./docker/Dockerfile
      network: host
    volumes:
      - ./backend:/app
      - /var/log/testkiss/python/:/logs/
    environment:
      - "SET_CONTAINER_TIMEZONE=true"
      - "TZ=Asia/Shanghai"
    working_dir: /app
    #command: python app.py
    command: tail -f app.py
    restart: unless-stopped
    depends_on:
      - mongodb
    ports:
      - "8080:8080"
    networks:
      - tnet

  mongodb:
    image: mongo:3.7
    restart: always
    environment:
      - MONGO_DATA_DIR=/data/db
      - MONGO_LOG_DIR=/data/logs
    volumes:
      - /data/testkiss/mongodb:/data/db
      - /var/log/testkiss/mongodb:/data/logs
    ports:
      - "27017:27017"
    networks:
      - tnet

Dockerfile

FROM python:3.6.8

RUN mkdir /pip
ADD ./backend/requirements.txt  /pip

RUN pip install --upgrade pip
RUN pip install -i https://mirrors.aliyun.com/pypi/simple/ -r /pip/requirements.txt

启动

docker-compose up -d

完整项目代码获取

完整代码+docker启动文件

0

评论 (0)

取消