Sign inSign up

lqbing/nonebotmanager

By lqbing

Updated about 6 years ago

Image
0

871

lqbing/nonebotmanager repository overview

NoneBotManager

docker-compose

docker-compose.yml

version: "3"
services:
  web:
    image: lqbing/nonebotmanager
    restart: always
    volumes:
      - ./local_settings.py:/workdir/conf/local_settings.py
    networks:
      - nonebot_manager_net
  nginx:
    image: nginx
    restart: always
    ports:
      - 8005:80
    volumes:
      - ./nginx.conf:/etc/nginx/conf.d/default.conf
      - ./static:/workdir/static
    networks:
      - nonebot_manager_net
networks:
  nonebot_manager_net:
    driver: bridge

nginx.conf

server {
    listen       80;
    listen  [::]:80;
    server_name  localhost;

    location /
    {
        proxy_pass http://web:8000/;
        proxy_set_header host $host;
        proxy_set_header X-Real-IP      $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    location /static/ {
        alias /workdir/static/;
        expires 30d;
    }

}

local_settings.py

import os
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',  # 数据库引擎
        'NAME': os.environ.get('DB_NAME') or 'nonebot',  # 数据库名
        'USER': os.environ.get('DB_USER') or 'nonebot',  # 账号
        'PASSWORD': os.environ.get('DB_PASSWORD') or '123456',  # 密码
        'HOST': os.environ.get('DB_HOST') or 'db host',  # HOST
        'PORT': int(os.environ.get('DB_PORT')) if os.environ.get('DB_PORT') else 3306,  # 端口
    }
}

Tag summary

Content type

Image

Digest

Size

69.9 MB

Last updated

about 6 years ago

docker pull lqbing/nonebotmanager