added bouncer
All checks were successful
backend-action / build-image (push) Successful in 42s

This commit is contained in:
2024-04-22 12:56:02 +07:00
parent 63a5ad8a00
commit eee12e5872
3 changed files with 35 additions and 10 deletions

View File

@@ -1,13 +1,23 @@
{$CADDY_BASE_HOST} { {
encode zstd gzip crowdsec {
reverse_proxy http://frontend:3000 api_url {$CROWDSEC_API_URL}
handle_path /api/* { api_key {$CROWDSEC_API_KEY}
reverse_proxy http://backend:3000
} }
handle_path /profileImages/* { }
rewrite * /sorvor{path}
reverse_proxy http://minio:9000
{$CADDY_BASE_HOST} {
route {
crowdsec
encode zstd gzip
reverse_proxy http://frontend:3000
handle_path /api/* {
reverse_proxy http://backend:3000
}
handle_path /profileImages/* {
rewrite * /sorvor{path}
reverse_proxy http://minio:9000
}
} }
log { log {
output file /var/log/caddy/access.log output file /var/log/caddy/access.log

14
caddy/Dockerfile Normal file
View File

@@ -0,0 +1,14 @@
ARG CADDY_VERSION=2
FROM caddy:${CADDY_VERSION}-builder-alpine AS builder
RUN xcaddy build \
--with github.com/mholt/caddy-l4 \
--with github.com/hslatman/caddy-crowdsec-bouncer/http@main \
--with github.com/hslatman/caddy-crowdsec-bouncer/layer4@main
FROM caddy:${CADDY_VERSION} AS caddy
WORKDIR /
COPY --from=builder /usr/bin/caddy /usr/bin/caddy

View File

@@ -32,7 +32,9 @@ services:
env_file: env_file:
- .env - .env
caddy: caddy:
image: caddy build:
context: ./caddy/
target: caddy
restart: unless-stopped restart: unless-stopped
env_file: env_file:
- .env - .env
@@ -64,7 +66,6 @@ services:
- crowdsec-db:/var/lib/crowdsec/data/ - crowdsec-db:/var/lib/crowdsec/data/
- crowdsec-config:/etc/crowdsec/ - crowdsec-config:/etc/crowdsec/
- ./crowdsec/acquis.yaml:/etc/crowdsec/acquis.yaml - ./crowdsec/acquis.yaml:/etc/crowdsec/acquis.yaml
- ./crowdsec/acquis-test.yaml:/etc/crowdsec/acquis-test.yaml
volumes: volumes:
crowdsec-db: crowdsec-db: