I’m working on setting up some self-hosted service and running into some issues with the proxy server. I’m a hobbyist w/ under 2yrs experience with web/hosting services so pardon me if I’m missing an obvious answer.
Using a RPi4 as host and running everything through docker. I’ve got a Caddy container and Airsonic container playing nicely. So airsonic.mydomain.com works just fine. The nextcloud and postgres container play just fine and run alone can be used and accessed locally. However, when I try to add the proxy for the nextcloud container the entire thing falls apart. By that I mean the airsonic, nextcloud and, postgres containers start up just fine, the caddy container seems to stick on restarting. Only difference is the new caddyfile and starting all four services from a single docker-compose.yml.
My working caddyfile with the additions for multiple proxies commented out
pi@rpi4:/media/storage/data/airsonic $ cat ../caddy/Caddyfile
#mydomain.com {
# root /www/mydomain.com
#}
#
music.mydomain.com {
proxy / http://loc.al.ip.03:4040 {
transparent
}
}
#
#cloud.mydomain.com {
# proxy / http://loc.al.ip.002:80 {
# transparent
# web-socket
# }
#}
If it helps here is the docker-compose.yml in which the caddy container get stuck restarting
---
version: "2"
networks:
static-network:
ipam:
config:
- subnet: 172.20.0.0/16
ip_range: 172.28.5.0/24
services:
db:
image: postgres:alpine
container_name: cloud-db
restart: always
volumes:
- /media/storage/data/nextcloud/database:/var/lib/postgresql/data
env_file:
- /media/storage/data/nextcloud/db.env
networks:
static-network:
ipv4_address: 172.20.0.1
cloud:
image: nextcloud:apache
container_name: cloud-service
links:
- db
environment:
- POSTGRES_HOST=db
- PUID=33
- PGID=33
env_file:
- /media/storage/data/nextcloud/db.env
volumes:
- /media/storage/data/nextcloud/html:/var/www/html
- /media/backup/nextcloud:/var/www/html/data
depends_on:
- db
restart: always
networks:
static-network:
ipv4_address: 172.20.0.2
airsonic:
image: linuxserver/airsonic
container_name: audio-stream
environment:
- PUID=1000
- PGID=1000
- TZ=America/Chicago
volumes:
- /media/storage/data/airsonic/config:/config
- /media/music:/music
- /media/storage/data/airsonic/playlists:/playlists
- /media/storage/data/airsonic/podcasts:/podcasts
networks:
static-network:
ipv4_address: 172.20.0.3
restart: unless-stopped
caddy:
image: jessestuart/caddy
container_name: proxy-service
environment:
- ACME_AGREE=true
volumes:
- /media/storage/data/caddy/.caddy:/root/.caddy
- /media/storage/data/caddy/Caddyfile:/etc/Caddyfile
networks:
static-network:
ipv4_address: 172.20.0.99
ports:
- 80:80
- 443:443
restart: unless-stopped
Any help would be great, I’m stuck at the moment.