renhai-lab / sgcc_electricity

本应用可以帮助你将国网的电费、用电量数据接入homeassistant,并且储存到数据库。
160 stars 44 forks source link

README文档docekr-compose.yml文件名错误 #2

Closed 907739769 closed 1 year ago

907739769 commented 1 year ago

README文档docekr-compose.yml文件名错误

docekr-compose.yml==>docker-compose.yml

renhai-lab commented 1 year ago

谢谢提醒,已修改。

907739769 commented 1 year ago

建议数据库配置及docker-compose.yml配置。 MONGO_URL="mongodb://USERNAME:PASSWORD@mongo-for-sgcc:27017/" # 数据库地址 修改USERNAME PASSWORD和mongo-for-sgcc和mongo容器名称一致


services:
  app:
    env_file:
      - .env
    depends_on:
      - mongo
    image: renhai/sgcc_electricity:latest # armv7 32架构的镜像为armv7-latest
    container_name: sgcc_electricity
    networks:
      sgcc_network:
    environment:
      - SET_CONTAINER_TIMEZONE=true
      - CONTAINER_TIMEZONE=Asia/Shanghai
    restart: unless-stopped
    command: python3 main.py

# 默认将近30天数据写入mongo数据库,方便查询
  mongo:
    image: mongo:4.4.18
    restart: always
    container_name: mongo-for-sgcc
    networks:
      sgcc_network:
    environment:
      MONGO_INITDB_ROOT_USERNAME: USERNAME # 修改为自己的用户名
      MONGO_INITDB_ROOT_PASSWORD: PASSWORD # 修改为自己的密码
      MONGODB_DATABASE: "homeassistant" # 修改为自己的数据库名,和.env中的数据库名一致
      CONTAINER_TIMEZONE: Asia/Shanghai
    volumes:
      - ./db:/data/db

networks:
   sgcc_network:
renhai-lab commented 1 year ago

已修改 @907739769