Skip to content

Commit 0ac97c5

Browse files
committed
fix #56
1 parent bae1767 commit 0ac97c5

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

Dockerfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Use a Go base image to build the Caddy binary
2-
FROM golang:1.22.3-alpine AS builder
2+
FROM golang:1.24-alpine AS builder
33

44
# Install git and xcaddy (required for cloning the repository and building Caddy)
55
RUN apk add --no-cache git wget && \
@@ -14,10 +14,7 @@ RUN git clone https://github.com/fabriziosalmi/caddy-waf.git
1414
# Navigate into the caddy-waf directory
1515
WORKDIR /app/caddy-waf
1616

17-
# Fetch and install the required Go modules (including Caddy v2)
18-
RUN go get -v github.com/caddyserver/caddy/v2 github.com/caddyserver/caddy/v2/caddyconfig/caddyfile github.com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile github.com/caddyserver/caddy/v2 github.com/caddyserver/caddy/v2/modules/caddyhttp github.com/oschwald/maxminddb-golang github.com/fsnotify/fsnotify github.com/fabriziosalmi/caddy-waf
19-
20-
# Clean up and update the go.mod file
17+
# Clean up and update the go.mod file (dependencies are already defined in go.mod)
2118
RUN go mod tidy
2219

2320
# Download the GeoLite2 Country database

docker-compose.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
services:
2+
caddy-waf:
3+
build: .
4+
ports:
5+
- "8080:8080"
6+
volumes:
7+
- ./Caddyfile:/app/Caddyfile:ro
8+
- ./rules.json:/app/rules.json:ro
9+
- ./ip_blacklist.txt:/app/ip_blacklist.txt:ro
10+
- ./dns_blacklist.txt:/app/dns_blacklist.txt:ro
11+
restart: unless-stopped
12+
environment:
13+
- CADDY_ADMIN=0.0.0.0:2019
14+
networks:
15+
- caddy-waf-net
16+
17+
networks:
18+
caddy-waf-net:
19+
driver: bridge

0 commit comments

Comments
 (0)