inital setup
This commit is contained in:
5
.env.sample
Normal file
5
.env.sample
Normal file
@@ -0,0 +1,5 @@
|
||||
TAG=
|
||||
APIPORT=
|
||||
BASEDIR=
|
||||
EXTRANET=
|
||||
INTRANET=
|
||||
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
files/
|
||||
.env
|
||||
34
docker-compose.yml
Normal file
34
docker-compose.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
# https://docs.docker.com/compose/compose-file/compose-file-v3/
|
||||
---
|
||||
version: "3.9"
|
||||
services:
|
||||
caddy:
|
||||
image: caddy:${TAG:-alpine}
|
||||
container_name: caddy
|
||||
env_file: .env
|
||||
restart: unless-stopped
|
||||
deploy:
|
||||
replicas: 1 # in swarm set min 2
|
||||
placement:
|
||||
max_replicas_per_node: 1
|
||||
update_config:
|
||||
parallelism: 1
|
||||
delay: 10s
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
- ${APIPORT:-2019}:2019
|
||||
volumes:
|
||||
- ${BASEDIR:-./files}/conf:/etc/caddy/
|
||||
- ${BASEDIR:-./files}/data/:/data
|
||||
networks:
|
||||
- frontend
|
||||
- backend
|
||||
|
||||
networks:
|
||||
frontend:
|
||||
name: ${EXTRANET:-frontend}
|
||||
external: true
|
||||
backend:
|
||||
name: ${INTRANET:-backend}
|
||||
external: true
|
||||
2
files/conf/Caddyfile
Normal file
2
files/conf/Caddyfile
Normal file
@@ -0,0 +1,2 @@
|
||||
import snippets/*
|
||||
import pages/*
|
||||
4
files/conf/pages/example.com
Normal file
4
files/conf/pages/example.com
Normal file
@@ -0,0 +1,4 @@
|
||||
http://example.com {
|
||||
import auth "*"
|
||||
respond "example.com here!"
|
||||
}
|
||||
12
files/conf/snippets/auth
Normal file
12
files/conf/snippets/auth
Normal file
@@ -0,0 +1,12 @@
|
||||
## generate pass hash (debian):
|
||||
# sudo apt install apache2-utils
|
||||
# htpasswd -bnBC 10 "" password | tr -d ':'
|
||||
|
||||
# user: test
|
||||
# password: password
|
||||
|
||||
(auth) {
|
||||
basicauth {args.0} {
|
||||
test $2y$10$XSrHHXUlQZeRumAc9nl7QevDzKv9H5TXVtb6nxr0Gmrk6VogHWRVK
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user