moq-rs/docker-compose.yml

55 lines
1.2 KiB
YAML

version: "3.8"
x-relay: &x-relay
build: .
entrypoint: ["moq-relay"]
environment:
RUST_LOG: ${RUST_LOG:-debug}
volumes:
- ./dev/localhost.crt:/etc/tls/cert:ro
- ./dev/localhost.key:/etc/tls/key:ro
- certs:/etc/ssl/certs
depends_on:
install-certs:
condition: service_completed_successfully
services:
redis:
image: redis:7
ports:
- "6400:6379"
api:
build: .
entrypoint: moq-api
command: --listen [::]:4442 --redis redis://redis:6379
relay1:
<<: *x-relay
command: --listen [::]:4443 --tls-cert /etc/tls/cert --tls-key /etc/tls/key --api http://api:4442 --api-node https://relay1:4443 --dev
ports:
- "4443:4443"
- "4443:4443/udp"
relay2:
<<: *x-relay
command: --listen [::]:4443 --tls-cert /etc/tls/cert --tls-key /etc/tls/key --api http://api:4442 --api-node https://relay2:4443 --dev
ports:
- "4444:4443"
- "4444:4443/udp"
install-certs:
image: golang:latest
working_dir: /work
command: go run filippo.io/mkcert -install
environment:
CAROOT: /work/caroot
volumes:
- ${CAROOT:-.}:/work/caroot
- certs:/etc/ssl/certs
- ./dev/go.mod:/work/go.mod:ro
- ./dev/go.sum:/work/go.sum:ro
volumes:
certs: