services:
    reverse-proxy:
        image: ghcr.io/lanedirt/aliasvault-reverse-proxy:latest
        ports:
            - "80:80"
            - "443:443"
        volumes:
            - ./certificates/ssl:/etc/nginx/ssl:rw
            - ./certificates/letsencrypt:/etc/nginx/ssl-letsencrypt:rw
            - ./certificates/letsencrypt/www:/var/www/certbot:rw
        depends_on:
            - admin
            - client
            - api
            - smtp
        restart: always
        env_file:
            - .env

    client:
        image: ghcr.io/lanedirt/aliasvault-client:latest
        volumes:
            - ./logs/msbuild:/src/msbuild-logs:rw
        expose:
            - "3000"
        restart: always
        env_file:
            - .env

    api:
        image: ghcr.io/lanedirt/aliasvault-api:latest
        expose:
            - "3001"
        volumes:
            - ./database:/database:rw
            - ./certificates/app:/certificates/app:rw
            - ./logs:/logs:rw
        env_file:
            - .env
        restart: always

    admin:
        image: ghcr.io/lanedirt/aliasvault-admin:latest
        expose:
            - "3002"
        volumes:
            - ./database:/database:rw
            - ./certificates/app:/certificates/app:rw
            - ./logs:/logs:rw
        restart: always
        env_file:
            - .env

    smtp:
        image: ghcr.io/lanedirt/aliasvault-smtp:latest
        ports:
            - "25:25"
            - "587:587"
        volumes:
            - ./database:/database:rw
            - ./logs:/logs:rw
        env_file:
            - .env
        restart: always

networks:
    aliasvault:
        name: aliasvault_default
