version: "3"

services:
  web:
    # Choose one of these tags:
    # stable-amd64, stable-arm64, beta-amd64, beta-arm64
    image: registry.joinfirefish.org/firefish/firefish:beta-amd64
    container_name: rudeshark_web
    restart: unless-stopped
    depends_on:
      - db
      - redis
      - meilisearch
#     - sonic
    ports:
      - "127.0.0.1:8071:3000"
    networks:
      - firenet
#     - web
    environment:
      NODE_ENV: production
    volumes:
      - ./files:/firefish/files
      - ./.config:/firefish/.config:ro

  redis:
    restart: unless-stopped
    image: docker.io/redis:7-alpine
    container_name: rudeshark_redis
    networks:
      - firenet
    volumes:
      - ./redis:/data

  db:
    restart: unless-stopped
    image: docker.io/postgres:15-alpine
    container_name: rudeshark_db
    networks:
      - firenet
    env_file:
      - .config/docker.env
    volumes:
      - ./postgresql:/var/lib/postgresql/data

### Only one of the below should be used.
### Meilisearch is better overall, but resource-intensive. Sonic is a very light full text search engine.

  meilisearch:
    container_name: rudeshark_meilisearch
    image: getmeili/meilisearch:v1.1.1
    environment:
      - MEILI_ENV=production
    env_file:
      - ./.config/meilisearch.env
#    ports:
#      - "127.0.0.1:7706:7700"
    networks:
      - firenet
    volumes:
      - ./meilisearch/data:/meili_data
    restart: unless-stopped

#  sonic:
#    restart: unless-stopped
#    image: docker.io/valeriansaliou/sonic:v1.4.0
#    logging:
#     driver: none
#    networks:
#      - firenet
#    volumes:
#      - ./sonic:/var/lib/sonic/store
#      - ./sonic/config.cfg:/etc/sonic.cfg

networks:
  firenet:
    ipam:
      config:
        - subnet: 172.22.22.0/24
  #  web:
  #    external:
  #      name: web
