name: proxy-server

services:

  postgres:
    container_name: proxy-server-dev-postgres
    image: postgres:17
    environment:
      POSTGRES_DB: $DB_DATABASE
      POSTGRES_USER: $DB_USERNAME
      POSTGRES_PASSWORD: $DB_PASSWORD
    ports:
      - "${DB_PORT}:5432"
    volumes:
      - postgres-data:/var/lib/postgresql/data
    networks:
      - proxy-server-test
    restart: always

  service:
    container_name: proxy-server-dev-service
    build:
      context: ../../..
      dockerfile: Dockerfile
    environment:
      APP_CTRL_PORT: $APP_CTRL_PORT
      APP_DATA_PORT: $APP_DATA_PORT
      APP_LOG_MODE: $APP_LOG_MODE
      DB_HOST: $DB_HOST
      DB_PORT: $DB_PORT
      DB_DATABASE: $DB_DATABASE
      DB_USERNAME: $DB_USERNAME
      DB_PASSWORD: $DB_PASSWORD
      DB_TIMEZONE: $DB_TIMEZONE
    ports:
      - "${APP_CTRL_PORT}:${APP_CTRL_PORT}"
      - "${APP_DATA_PORT}:${APP_DATA_PORT}"
      - "6060:6060"
      - "20000-20100:20000-20100"
    networks:
      - proxy-server-test
    depends_on:
      - postgres
    restart: always

  vector:
    container_name: proxy-server-dev-vector
    build:
      context: ./vector
      dockerfile: Dockerfile
    ports:
      - "8686:8686"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /var/log/vector:/temp/vector
    networks:
      - proxy-server-test
    depends_on:
      - service
    restart: always

networks:
  proxy-server-test:
    driver: bridge

volumes:
  postgres-data:
    name: proxy-server-test-postgres-data
