services:
  app:
    image: registry.gitlab.com/dev-initialde/municipalityapi:${IMAGE_TAG}
    ports:
      - "9094:9090"
    environment:
      SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/payOnline
      SPRING_DATASOURCE_USERNAME: initial_user
      SPRING_DATASOURCE_PASSWORD: jydtE6-dodvac-fyhtot
    depends_on:
      - postgres
      - redis
    networks:
      - pay-online-net
    restart: unless-stopped

  postgres:
    image: postgres:15
    container_name: pay-online-postgres
    environment:
      POSTGRES_DB: payOnline
      POSTGRES_USER: initial_user
      POSTGRES_PASSWORD: jydtE6-dodvac-fyhtot
    volumes:
      - postgres_data:/var/lib/postgresql/data
    networks:
      - pay-online-net
    restart: unless-stopped

  redis:
    image: redis:7-alpine
    container_name: pay-online-cache
    ports:
      - "6383:6379"
    command: [ "redis-server", "/redis/config/redis.conf" ]
    volumes:
      - ./redis/config:/redis/config
      - ./redis/data:/redis/data
      - ./redis/log:/redis/log
    networks:
      - pay-online-net
    restart: unless-stopped

volumes:
  postgres_data:

networks:
  pay-online-net:
    driver: bridge