Skip to content

Preconfigured Caddy container for local https development

Notifications You must be signed in to change notification settings

clevyr/docker-caddy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-caddy

Docker Build

Preconfigured Caddy container for local https development environments.

Pull Command

docker pull ghcr.io/clevyr/caddy

Config

Variable Description Default
SITE_ADDRESS Address used to serve requests. clevyr.run
APP_ADDRESS Upstream for https://$SITE_ADDRESS/* and wildcard subdomains. app
API_ADDRESS Upstream for https://api.$SITE_ADDRESS/*. app
HOT_ADDRESS Upstream for https://hot.$SITE_ADDRESS/. hot:5173
MAIL_ADDRESS Upstream for https://mail.$SITE_ADDRESS/*. mail
WS_ADDRESS Upstream for https://ws.$SITE_ADDRESS/*. websocket-server:6001
SOCKETIO_ADDRESS Upstream for https://$SITE_ADDRESS/socket.io/* app
LOG_OUTPUT Log output module. See Caddy log output modules. discard

Usage

Adding to an app

Add this Docker image to an app's docker-compose.yml with a volume bind in a global location. This allows for the root CA to persist between applications.

proxy:
  image: clevyr/caddy
  ports:
    - 80:80
    - 443:443
  restart: unless-stopped
  volumes:
    - ~/.config/caddy:/data

Trusting the root CA

Trusting the root CA is safe as long as the file is never shared. This will make sites work with a valid https certificate which is unique for each machine.
To trust the local root CA on macOS, run the following command:

security add-trusted-cert -r trustRoot -k ~/Library/Keychains/login.keychain-db ~/.config/caddy/caddy/pki/authorities/local/root.crt

About

Preconfigured Caddy container for local https development

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors 3

  •  
  •  
  •