# SPDX-FileCopyrightText: 2024 Tazlin # SPDX-FileCopyrightText: 2024 ceruleandeep # # SPDX-License-Identifier: AGPL-3.0-or-later services: aihorde: build: context: . dockerfile: Dockerfile image: aihorde:latest container_name: aihorde ports: - "7001:7001" # The port number written in front of the colon (:) is the port number to be exposed to the outside, so if you change it, you can access it with localhost:{changePort}. environment: # Flask obtains its environment variables from the .env file. # If you set a profile, the .env_{PROFILE} file is read instead. - PROFILE=docker volumes: # .env_{PROFILE} is copied into the image when it is built. # So that you can change the environment variables without rebuilding the image, mount the .env file. - .env_docker:/app/.env_docker # Likewise, you can mount the horde directory to change the source code without rebuilding the image. - ./horde:/app/horde networks: - aihorde_network depends_on: - postgres - redis postgres: image: ghcr.io/haidra-org/ai-horde-postgres:latest container_name: postgres restart: always environment: POSTGRES_PASSWORD: changeme volumes: # Use a named volume to persist the data even if the container is deleted. - postgres_data:/var/lib/postgresql/data/ ports: - "5432:5432" networks: - aihorde_network redis: image: redis:7 container_name: redis restart: always ports: - "6379:6379" networks: - aihorde_network networks: aihorde_network: driver: bridge volumes: postgres_data: