Skip to content

Caddy recipe does not work using docker-compose.yml configuration #311

Open
@tomsiwik

Description

@tomsiwik

I'm unsuccessfully trying to make caddy work with gitlab using given recipe. However, i'm currently stuck at 502 and searching and finding the same configurations of caddy and gitlab through a reverse proxy setup everywhere. Can somebody help me out and tell me if my current configuration is valid or what i'm actually doing wrong?

Caddyfile:

https://git.example.com {

    tls [email protected]

    log git.access.log {
        rotate_size     50
        rotate_age      90
        rotate_keep     20
        rotate_compress
    }

    errors git.errors.log {
        404 /var/gitlab/404.html
        422 /var/gitlab/422.html
        500 /var/gitlab/500.html
        502 /var/gitlab/502.html
    }

    proxy / gitlab:8181 {
        fail_timeout 0s
        header_upstream X-Forwarded-Ssl on
        transparent
    }
}

https://*.pages.example.com {
    tls { max_certs 15 }

    proxy / gitlab:8090 {
        fail_timeout 0s
        transparent
    }
}

docker-compose.yml:

version: '3.3'

volumes:
    gitlab:

services:
    gitlab:
        container_name: gitlab
        image: gitlab/gitlab-ee:latest
        restart: always
        expose:
            - "8181"
            - "8090"
        environment:
            GITLAB_OMNIBUS_CONFIG: |
                external_url 'https://git.example.com'
                gitlab_workhorse['listen_network'] = "tcp"
                gitlab_workhorse['listen_addr'] = "localhost:8181"
                nginx['enable'] = "false"
                nginx['custom_gitlab_server_config'] = "proxy_buffering off;"

                pages_external_url 'https://pages.example.com'
                gitlab_pages['enable'] = true
                gitlab_pages['listen_proxy'] = "localhost:8090"
                gitlab_pages['redirect_http'] = true
                gitlab_pages['use_http2'] = true
        volumes:
            - "gitlab:/opt/gitlab/embedded/service/gitlab-rails/public"
            - "./gitlab:/etc/gitlab"
            - "./log/gitlab:/var/log/gitlab"
            - "./opt/gitlab:/var/opt/gitlab"

    caddy:
        build:
            context: github.com/abiosoft/caddy-docker.git
            args:
                plugins: reauth
        image: abiosoft/caddy
        container_name: caddy
        ports:
            - "80:80"
            - "443:443"
        links:
            - gitlab
        volumes:
            - "gitlab:/var/gitlab"
            - "./Caddyfile:/etc/Caddyfile"
            - "./www:/var/www"
        restart: always

Troubleshooting so far:

curl -L gitlab:8181 inside caddy container returns connection refused.
curl -L localhost:8181 inside caddy container returns valid html.

Any suggestions i might try?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions