L

Lararu.Blog

Make It Happen.

  • 首页
  • DEVOPS
  • Python-Dev
  • Docker
  • 关于
Home docker部署Caddyfile
文章

docker部署Caddyfile

Posted 2025-03-1 Updated 2025-03- 1
By Administrator
2~3 min read

docker run -d \
  --name caddy_test \
  -p 8084:80 \
  -p 8045:443 \
  -v $PWD/Caddyfile:/etc/caddy/Caddyfile \
  -v $PWD/caddy_data:/data \
  -v $PWD/html:/var/www/html \
  caddy

Caddyfile示例

# The Caddyfile is an easy way to configure your Caddy web server.
#
# Unless the file starts with a global options block, the first
# uncommented line is always the address of your site.
#
# To use your own domain name (with automatic HTTPS), first make
# sure your domain's A/AAAA DNS records are properly pointed to
# this machine's public IP, then replace ":80" below with your
# domain name.

:80 {
    # Set this path to your site's directory.
    root * /var/www/html

    # Enable the static file server.
    file_server

    # Another common task is to set up a reverse proxy:
    # reverse_proxy localhost:8080

    # Or serve a PHP site through php-fpm:
    # php_fastcgi localhost:9000
}

# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile

License:  CC BY 4.0
Share

Further Reading

OLDER

docker部署umami

NEWER

docker部署vs code

Recently Updated

  • flask 发邮件项目
  • docker部署nginx
  • ubuntu server安装podman
  • 韩国Emart全球供应链研究
  • 安卓手机termux安装ubuntu或者Alpine Linux

Trending Tags

Python-dev Ubuntu Database PVE DevOps Docker Docker-compose

Contents

©2025 Lararu.Blog. Some rights reserved.

Using the Halo theme Chirpy