version: "3"

services:
    redis:
        image: 'redis'
        restart: "no"

    xmltools-frontend:
        build: ./Frontend
        container_name: xmltools-frontend
        image: xmltools-frontend
        ports:
            - 80:80

    xmltools-backend:
        build: ./Backend/tools-services
        container_name: xmltools-backend
        image: xmltools-backend
        ports:
            - 8081:8081

    xmltools-libxml-backend:
        build: ./Backend-libXML
        container_name: xmltools-libxml-backend
        image: xmltools-libxml-backend
        ports:
            - 8082:80

    xmltools-mocked-services:
        build:
            context: ./Backend/mocked-services
            dockerfile: Dockerfile
        container_name: xmltools-mocked-services
        restart: "no"
        ports:
            - "8097:8097"
        depends_on:
            - redis
        environment:
            SPRING_PROFILES_ACTIVE: DEV
            TZ: Europe/Warsaw

    swagger:
        image: "swaggerapi/swagger-ui:latest"
        container_name: xmltools-swagger
        ports:
            - "8000:8080"
        environment:
            - BASE_URL=/swagger
            - SWAGGER_JSON=/Swagger/swagger.json
        volumes:
            - ./Swagger:/Swagger

    filebeat:
        build: ./Filebeat
        container_name: xmltools-filebeat
        user: root
        volumes:
            - "./Filebeat/filebeat.docker.yml:/usr/share/filebeat/filebeat.yml:ro"
            - "/var/lib/docker/containers:/var/lib/docker/containers:ro"
            - "/var/run/docker.sock:/var/run/docker.sock:ro"
        environment:
            - ENV_TYPE
        command:
            - "-e"
            - "--strict.perms=false"

networks:
    default:
        name: tools_network
