services:
    code_server:
        command: --auth none --disable-telemetry
        container_name: code_server
        env_file:
            - .env
        image: 'codercom/code-server:latest'
        labels:
            traefik.docker.network: traefik
            traefik.enable: true
            traefik.http.routers.code_server.entrypoints: websecure
            traefik.http.routers.code_server.rule: Host(`codeserver.alexlebens.net`)
            traefik.http.routers.code_server.service: code_server
            traefik.http.routers.code_server.middlewares: authentik@file
            traefik.http.services.code_server.loadbalancer.server.port: 8080
        logging:
            driver: json-file
            options:
                max-size: 50m
                max-file: "3"
        networks:
            traefik: null
        restart: always
        user: "1000:1000"
        volumes:
            - home:/home/coder/

networks:
    traefik:
        name: traefik
        external: true

volumes:
    home:
        driver: local
        driver_opts:
            type: none
            o: bind
            device: /opt/code_server_home/
