diff --git a/README.md b/README.md index e9ef86c..eca0654 100644 --- a/README.md +++ b/README.md @@ -36,12 +36,12 @@
A UI for managing Caddy configuration files
- Explore the docs »
+ Explore the docs »
- Report Bug (label bug)
+ Report Bug (label bug)
·
- Request Feature (label enhancement)
+ Request Feature (label enhancement)
[//]: # ( View Demo)
@@ -125,52 +125,46 @@ These software are required to be installed on the host machine:
- /path/to/configs:/etc/caddy
```
-### Installation
+### Global Caddy configuration
-This repository can be cloned and then built with DotNet. Using the `dotnet publish` command can have the container image built and pushed to the registry.
+Add this directive at the end of your caddy configuration (global):
-1. Clone the repo
- ```shell
- git clone https://pikachu-gitea.duydao.org/ebolo/CaddyManager.git
- cd CaddyManager
- ```
-2. Login to the container registry (optional, only need to publish to a remote registry)
- ```shell
- docker login -u $USER_NAME $REGISTRY_URL
- ```
-3. Build and publish container with DotNet
- ```shell
- dotnet publish --os linux --arch x64 /t:PublishContainer -p ContainerRegistry=$REGISTRY_URL
- ```
- if publishing to only the local machine, the `ContainerRegistry` parameter can be omitted.
- ```shell
- dotnet publish --os linux --arch x64 /t:PublishContainer
- ```
+```
+import *.caddy
+```
+
+This is to have the caddy files managed by this application be imported and work as expected.
+
+### Installation with Docker compose
-Then the container can be run with Docker compose:
```yaml
services:
caddy:
- image: caddy-manager:latest
+ image: caddy:latest
+ container_name: caddy
+ restart: always
+ network_mode: "host"
+ security_opt:
+ - label:disable
+ volumes:
+ - /root/compose/caddy/config:/etc/caddy
+ - /etc/localtime:/etc/localtime:ro
+
+ caddy-manager:
+ image: ghcr.io/daothanhduy305/caddymanager
container_name: caddy-manager
restart: always
environment:
- - Caddy__ConfigDir=/config # The directory where Caddy configuration files are stored
- - Docker__CaddyContainerName=caddy # The name of the Caddy container
- user: "${UID}:${GID}"
- # The user and group ID of the host user having the permission to write to the Caddy configuration directory
+ ASPNETCORE_ENVIRONMENT: "Production"
+ CaddyService__ConfigDir: "/config"
+ DockerService__CaddyContainerName: "caddy"
+ # To have the access to the caddy config file
+ user: "1000:1000"
ports:
- "8080:8080"
volumes:
- /root/compose/caddy/config:/config
- /var/run/docker.sock:/var/run/docker.sock
-
-```
-
-Example of `.env` file. The `UID` and `GID` are the user and group ID of the host user having the permission to write to the Caddy configuration directory:
-```shell
-UID=1000 # can be 0 as root user
-GID=1000 # can be 0 as root group
```