version: '3.9'

services:
  niki_app_stage:
    image: niki:${STAGE_NIKI_IMAGE_VERSION?error}
    container_name: niki_app_stage
    environment:
      EB_MARIADB__HOST: niki_stage_mariadb
      EB_MARIADB__PORT: ${COMPOSE_MARIADB_PORT?error}
      EB_MARIADB__DB_NAME: ${COMPOSE_MARIADB_DATABASE?error}
      EB_MARIADB__USERNAME: ${COMPOSE_MARIADB_USER?error}
      EB_MARIADB__PASSWORD: ${COMPOSE_MARIADB_UR_PASSWORD?error}

      EB_REDIS__HOST: niki_stage_redis
      EB_REDIS__PORT: ${COMPOSE_REDIS_PORT?error}
      EB_REDIS__DB: ${COMPOSE_REDIS_DB?error}
      EB_REDIS__PASSWORD: ${COMPOSE_REDIS_PASSWORD?error}

      EB_AUTH__SIGN_KEY: ${COMPOSE_AUTH_SIGN_KEY?error}
      EB_ADMIN_AUTH__SIGN_KEY: ${COMPOSE_ADMIN_AUTH_SIGN_KEY?error}
    restart: always
    ports:
      - "127.0.0.1:8313:1313"
    networks:
      - niki-stage
    volumes:
      - './config.yml:/config.yml'

networks:
  niki-stage:
    external: true

# STAGE_NIKI_IMAGE_VERSION=770f31ea docker compose -p niki_app_stage up -d