version: "3.9" services: # default insights-bot service that would pull the image from docker hub # and runs on production environment with db_local service and redis_local # service # # you need to use either docker compose up --profile hub -d or docker-compose --profile hub up -d # to ask docker compose to run this service insights_bot: profiles: - hub image: ghcr.io/nekomeowww/insights-bot:latest restart: always environment: - TIMEZONE_SHIFT_SECONDS - TELEGRAM_BOT_TOKEN # # uncomment the following lines if you configured telegram webhook in .env file # - TELEGRAM_BOT_WEBHOOK_URL # - TELEGRAM_BOT_WEBHOOK_PORT - OPENAI_API_SECRET - OPENAI_API_HOST - OPENAI_API_MODEL_NAME - OPENAI_API_TOKEN_LIMIT - OPENAI_API_CHAT_HISTORIES_RECAP_TOKEN_LIMIT - DB_CONNECTION_STR - REDIS_HOST=redis_local - REDIS_PORT=6379 - REDIS_TLS_ENABLED=false - REDIS_PASSWORD=123456 - REDIS_CLIENT_CACHE_ENABLED - LOG_LEVEL # # uncomment the following lines if you configured slack and it's webhook options in .env file # - SLACK_CLIENT_ID # - SLACK_CLIENT_SECRET # - SLACK_WEBHOOK_PORT # # uncomment the following lines if you configured discord bot webhook in .env file # - DISCORD_BOT_TOKEN # - DISCORD_BOT_PUBLIC_KEY # - DISCORD_BOT_WEBHOOK_PORT ports: - 7069:7069 - 7070:7070 # - ${DISCORD_BOT_WEBHOOK_PORT}:${DISCORD_BOT_WEBHOOK_PORT} # uncomment this line if you have set DISCORD_BOT_WEBHOOK_PORT in .env file healthcheck: test: curl --fail http://localhost:7069/health || exit 1 interval: 1s retries: 5 start_period: 1s timeout: 1s volumes: - insights_bot_logs:/var/log/insights-bot depends_on: - db_local - redis_local # On-demand build insights-bot service that would build the image from # source code and runs on production environment with db_local service # and redis_local service # # you need to use either docker compose up --profile local -d or docker-compose --profile local up -d # to ask docker compose to run this service insights_bot_local: profiles: - local build: context: . dockerfile: ./Dockerfile image: insights-bot restart: always environment: - TIMEZONE_SHIFT_SECONDS - TELEGRAM_BOT_TOKEN # # uncomment the following lines if you configured telegram webhook in .env file # - TELEGRAM_BOT_WEBHOOK_URL # - TELEGRAM_BOT_WEBHOOK_PORT - OPENAI_API_SECRET - OPENAI_API_HOST - OPENAI_API_MODEL_NAME - OPENAI_API_TOKEN_LIMIT - OPENAI_API_CHAT_HISTORIES_RECAP_TOKEN_LIMIT - DB_CONNECTION_STR - REDIS_HOST=redis_local - REDIS_PORT=6379 - REDIS_TLS_ENABLED=false - REDIS_PASSWORD=123456 - REDIS_CLIENT_CACHE_ENABLED - LOG_LEVEL # # uncomment the following lines if you configured slack and it's webhook options in .env file # - SLACK_CLIENT_ID # - SLACK_CLIENT_SECRET # - SLACK_WEBHOOK_PORT # # uncomment the following lines if you configured discord bot webhook in .env file # - DISCORD_BOT_TOKEN # - DISCORD_BOT_PUBLIC_KEY # - DISCORD_BOT_WEBHOOK_PORT ports: - 7069:7069 - 7070:7070 # - ${DISCORD_BOT_WEBHOOK_PORT}:${DISCORD_BOT_WEBHOOK_PORT} # uncomment this line if you have set DISCORD_BOT_WEBHOOK_PORT in .env file healthcheck: test: curl --fail http://localhost:7069/health || exit 1 interval: 10s retries: 5 timeout: 5s volumes: - insights_bot_logs:/var/log/insights-bot depends_on: - db_local - redis_local # the default PostgreSQL database service that helps insights-bot to store data # you can change the password by changing the POSTGRES_PASSWORD environment variable # and change the database name by changing the POSTGRES_DB environment variable # and change the username by changing the POSTGRES_USER environment variable # # NOTICE: if you have your own PostgreSQL database service, you can remove this service # and change the DB_CONNECTION_STR environment variable in insights_bot or # insights_bot_local service db_local: image: postgres:alpine restart: unless-stopped environment: - POSTGRES_PASSWORD=123456 - POSTGRES_USER=postgres - POSTGRES_DB=postgres volumes: - ./.postgres/data:/var/lib/postgresql/data healthcheck: test: [ "CMD-SHELL", "pg_isready -d $$POSTGRES_DB -U $$POSTGRES_USER" ] interval: 10s timeout: 5s retries: 5 # the default Redis service that helps insights-bot to store data # you can change the password by changing the REDIS_PASSWORD environment variable # and change the port by changing the REDIS_PORT environment variable # # NOTICE: if you have your own Redis service, you can remove this service # and change the REDIS_HOST and REDIS_PORT environment variable in insights_bot or # insights_bot_local service redis_local: image: redis:7 restart: unless-stopped environment: - REDIS_PASSWORD=123456 command: > /bin/sh -c "redis-server $${REDIS_PASSWORD:+--requirepass \"$$REDIS_PASSWORD\"}" healthcheck: test: [ "CMD-SHELL", "redis-cli -e $${REDIS_PASSWORD:+-a \"$$REDIS_PASSWORD\"} --no-auth-warning ping" ] interval: 10s timeout: 5s retries: 5 # # promtail service that helps insights-bot to collect logs # # you can uncomment the following lines if you want to enable promtail # promtail: # image: grafana/promtail:2.8.2 # restart: unless-stopped # volumes: # - ./production/promtail:/etc/promtail # you may edit the ./production/promtail/config.yaml file to suit your needs # - insights_bot_logs:/var/log/insights-bot:ro # command: > # -config.file=/etc/promtail/config.yaml # # uncomment the following lines if you want to view the web ui of promtail # # ports: # # - 9080:9080 # # uncomment the following lines if you want to use your own loki service # # networks: # # - # replace with your own loki network name volumes: insights_bot_logs: # uncomment the following lines if you want to use your own loki service # that live in another docker-compose.yml file # networks: # : # replace with your own loki network name # external: true