1. Caddy version (caddy version
):
2.3.0
2. How I run Caddy:
I run caddy in docker here is my configurations files
docker-compose
version: "3.4"
services:
php:
build:
context: ./api
target: php
depends_on:
- database
restart: unless-stopped
volumes:
- php_socket:/var/run/php
healthcheck:
interval: 10s
timeout: 3s
retries: 3
start_period: 30s
caddy:
build:
context: api/
target: caddy
depends_on:
- php
environment:
SERVER_NAME: ${SERVER_NAME:-localhost, caddy:80}
MERCURE_PUBLISHER_JWT_KEY: ${MERCURE_PUBLISHER_JWT_KEY}
MERCURE_SUBSCRIBER_JWT_KEY: ${MERCURE_SUBSCRIBER_JWT_KEY}
restart: unless-stopped
volumes:
- php_socket:/var/run/php
- caddy_data:/data
- caddy_config:/config
ports:
# HTTP
- target: 80
published: 80
protocol: tcp
# HTTPS
- target: 443
published: 443
protocol: tcp
# HTTP/3
- target: 443
published: 443
protocol: udp
database:
image: postgres:13-alpine
environment:
- POSTGRES_DB=${DATABASE}
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
- POSTGRES_USER=${DATABASE_USER}
volumes:
- db_data:/var/lib/postgresql/data:rw
volumes:
php_socket:
db_data:
caddy_data:
caddy_config:
dockerfile
FROM caddy:${CADDY_VERSION}-builder-alpine AS caddy_builder
RUN xcaddy build \
--with github.com/dunglas/mercure/caddy \
--with github.com/dunglas/vulcain/caddy
FROM caddy:${CADDY_VERSION} AS caddy
WORKDIR /srv/api
COPY --from=dunglas/mercure:v0.11 /srv/public /srv/mercure-assets/
COPY --from=caddy_builder /usr/bin/caddy /usr/bin/caddy
COPY --from=php /srv/api/public public/
COPY docker/caddy/Caddyfile /etc/caddy/Caddyfile
3. The problem I’m having:
after i start caddy i get error:
caddy_1 | panic: proto: file "pb.proto" is already registered
caddy_1 | See https://developers.google.com/protocol-buffers/docs/reference/go/faq#namespace-conflict
caddy_1 |
caddy_1 |
caddy_1 | goroutine 1 [running]:
caddy_1 | google.golang.org/protobuf/reflect/protoregistry.glob..func1(0x1c6a100, 0xc00032c540, 0x1c35ac0, 0xc00031c770, 0xc00032c540)
caddy_1 | google.golang.org/protobuf@v1.26.0/reflect/protoregistry/registry.go:54 +0x25f
caddy_1 | google.golang.org/protobuf/reflect/protoregistry.(*Files).RegisterFile(0xc00006a170, 0x1c73120, 0xc00032c540, 0x0, 0x0)
caddy_1 | google.golang.org/protobuf@v1.26.0/reflect/protoregistry/registry.go:127 +0xb72
caddy_1 | google.golang.org/protobuf/internal/filedesc.Builder.Build(0x0, 0x0, 0xc00032b200, 0x47a, 0x600, 0x800000003, 0x0, 0x1c49200, 0xc0001804b0, 0x1c52700, ...)
caddy_1 | google.golang.org/protobuf@v1.26.0/internal/filedesc/build.go:113 +0x1aa
caddy_1 | github.com/golang/protobuf/proto.RegisterFile(0x197dac2, 0x8, 0x26468e0, 0x2b3, 0x2b3)
caddy_1 | github.com/golang/protobuf@v1.5.2/proto/registry.go:48 +0x147
caddy_1 | github.com/dgraph-io/badger/v2/pb.init.1()
caddy_1 | github.com/dgraph-io/badger/v2@v2.2007.2/pb/pb.pb.go:650 +0x5a
tureality_caddy_1 exited with code 2