Setting up Docker Caddy w/ Already working Barebones Caddyfile

1. Caddy version (caddy version):

2. How I run Caddy:

Caddyfile on barebones Ubuntu 20.04 running as a systemd with autostart
I am attempting to get caddy working with docker containers

a. System environment:

Drauger OS (Ubuntu 20.04) Systemmd and Docker

d. My complete Caddyfile or JSON config:

requests.movies4you.stream {
    reverse_proxy 192.168.1.116:5000
    tls {
        dns cloudflare api-key
    }
}
accounts.movies4you.stream {
    reverse_proxy 192.168.1.116:8056
    tls {
        dns cloudflare api-key
    }
}
tv.movies4you.stream {
    reverse_proxy 192.168.1.116:8096
    tls {
        dns cloudflare api-key
    }
}
photos.techjunkiehosting.com {
    reverse_proxy 192.168.1.116:8088
    tls {
        dns cloudflare api-key
    }
}

3. The problem I’m having:

I’m not sure how to actually go about this. I am attempting to run a currently working Caddyfile but on barebones machine. I need to setup docker on my barebones machine in caddy. IE. i want to have caddy running my photoview docker container through my barebones machine on domain photos.techjunkiehosting.com. I know the current setup is 100% incorrect. It was posted just for a place to input the correct setup for it. Caddy currently runs dns off my cloudflare. If someone could help me or point me in the right direction to setup my reverse proxy for caddy and my barebones docker container photoview. Thank you! I posted in other related sources the last forum post where i was getting help with something else. I posted the comment in the links section for reference.

6. Links to relevant resources:

Post i made in another forum help post:

ive found this example

caddy: example.com
caddy.route: /source/*
caddy.route.0_uri: strip_prefix /source
caddy.route.1_rewrite: * /target{path}
caddy.route.2_reverse_proxy: {{upstreams}}

could someone explain in more detail what exactly i need to do be editing. Sorry i do not really understand

Have you read the docs on Docker Hub ?

That example with docker labels is from GitHub - lucaslorentz/caddy-docker-proxy: Caddy as a reverse proxy for Docker and is most definitely overkill for your usecase.

This topic was automatically closed after 30 days. New replies are no longer allowed.