Files
AI-Horde/docker-compose.yaml

71 lines
2.0 KiB
YAML

# SPDX-FileCopyrightText: 2024 Tazlin <tazlin.on.github@gmail.com>
# SPDX-FileCopyrightText: 2024 ceruleandeep
#
# SPDX-License-Identifier: AGPL-3.0-or-later
services:
aihorde:
build:
context: .
dockerfile: Dockerfile
args:
AI_HORDE_DEPENDENCY_GROUPS: ${AI_HORDE_DEPENDENCY_GROUPS:-}
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:
condition: service_healthy
redis:
condition: service_started
postgres:
image: ghcr.io/haidra-org/ai-horde-postgres:latest
container_name: postgres
restart: always
environment:
POSTGRES_PASSWORD: changeme
volumes:
# PostgreSQL 18+ keeps major-version-specific directories below this
# parent so an image update cannot reinterpret an older data directory.
- postgres_data:/var/lib/postgresql
ports:
- "5432:5432"
networks:
- aihorde_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 2s
timeout: 5s
retries: 30
redis:
image: redis:7
container_name: redis
restart: always
ports:
- "6379:6379"
networks:
- aihorde_network
networks:
aihorde_network:
driver: bridge
volumes:
postgres_data: