version: "3.7"

services:
    fretto:
        build:
            context: .
            dockerfile: Dockerfile
        container_name: fretto_app
        volumes:
            - .:/var/www
        ports:
            - "9000:9000"
        networks:
            - fretto_network
        deploy:
            resources:
                limits:
                    cpus: "2.0"
                    memory: 8G

    nginx:
        image: nginx:latest
        container_name: fretto_nginx
        volumes:
            - ./nginx.conf:/etc/nginx/nginx.conf
        ports:
            - "8081:80"
        networks:
            - fretto_network
        deploy:
            resources:
                limits:
                    cpus: "2.0"
                    memory: 8G

networks:
    fretto_network:
        driver: bridge
