diff --git a/relay/config.yml b/relay/config.yml new file mode 100644 index 0000000..93fdec5 --- /dev/null +++ b/relay/config.yml @@ -0,0 +1,10 @@ +relay: + mode: proxy + upstream: https://sentry.teknologiumum.com + host: 0.0.0.0 + port: 3000 + +spool: + envelopes: + path: /work/relay-spool + max_disk_size: 1GB diff --git a/relay/docker-compose.yml b/relay/docker-compose.yml new file mode 100644 index 0000000..cbc2391 --- /dev/null +++ b/relay/docker-compose.yml @@ -0,0 +1,52 @@ +services: + relay: + image: getsentry/relay:latest + command: run --config / + labels: + - "traefik.enable=true" + - "traefik.docker.network=public-web" + - "traefik.http.routers.relay.entrypoints=web,websecure" + - "traefik.http.routers.relay.rule=Host(`sin.sentry.teknologiumum.com`)" + - "traefik.http.routers.relay.tls.certresolver=tlsresolver" + - "traefik.http.routers.relay.middlewares=relay-header,relay-rate,relay-redirectscheme" + - "traefik.http.services.relay.loadbalancer.server.port=3000" + - "traefik.http.services.relay.loadbalancer.server.scheme=http" + - "traefik.http.services.relay.loadbalancer.healthcheck.interval=30s" + - "traefik.http.services.relay.loadbalancer.healthcheck.path=/api/relay/healthcheck/ready/" + - "traefik.http.middlewares.relay-rate.ratelimit.average=200" + - "traefik.http.middlewares.relay-rate.ratelimit.burst=300" + - "traefik.http.middlewares.relay-rate.ratelimit.period=1s" + - "traefik.http.middlewares.relay-header.headers.addvaryheader=true" + - "traefik.http.middlewares.relay-header.headers.frameDeny=true" + - "traefik.http.middlewares.relay-header.headers.browserxssfilter=true" + - "traefik.http.middlewares.relay-header.headers.stsSeconds=604800" + - "traefik.http.middlewares.relay-header.headers.stsIncludeSubdomains=true" + - "traefik.http.middlewares.relay-header.headers.browserXssFilter=true" + - "traefik.http.middlewares.relay-header.headers.contentTypeNosniff=true" + - "traefik.http.middlewares.relay-header.headers.customResponseHeaders.server=Teknologi Umum" + - "traefik.http.middlewares.relay-redirectscheme.redirectscheme.scheme=https" + - "traefik.http.middlewares.relay-redirectscheme.redirectscheme.permanent=true" + - "com.centurylinklabs.watchtower.enable=true" + platform: linux/amd64 + deploy: + mode: replicated + replicas: 1 + restart_policy: + condition: unless-stopped + delay: 30s + window: 120s + resources: + limits: + memory: 1GB + cpus: '2' + reservations: + memory: 10M + cpus: '0.05' + networks: + - public-web + volumes: + - ./config.yml:/config.yml + +networks: + public-web: + external: true diff --git a/setup.py b/setup.py index 4cb01fb..a9ec629 100644 --- a/setup.py +++ b/setup.py @@ -87,7 +87,7 @@ def ping(host: str) -> bool: for container in containers: # Copy directory to destination subprocess.call( - f"rsync -avz --progress {container} {server}:{container}".split(" "), + f"rsync -avrz --progress {container}/ {server}:{container}".split(" "), stdout=sys.stdout, stderr=sys.stderr, ) diff --git a/traefik/docker-compose.yml b/traefik/docker-compose.yml index c8af230..216b7d7 100644 --- a/traefik/docker-compose.yml +++ b/traefik/docker-compose.yml @@ -56,7 +56,6 @@ services: resources: limits: memory: 4GB - cpus: "4" reservations: memory: 100MB cpus: "0.10" diff --git a/traefik/setup.sh b/traefik/setup.sh index ff9caab..745d413 100755 --- a/traefik/setup.sh +++ b/traefik/setup.sh @@ -2,4 +2,4 @@ docker network create public-web -d bridge --subnet 172.31.0.0/22 -docker network craete monitoring +docker network create monitoring diff --git a/uptime-kuma/docker-compose.yml b/uptime-kuma/docker-compose.yml index c196036..5545f42 100644 --- a/uptime-kuma/docker-compose.yml +++ b/uptime-kuma/docker-compose.yml @@ -3,6 +3,7 @@ services: image: louislam/uptime-kuma:1 labels: - "traefik.enable=true" + - "traefik.docker.network=public-web" - "traefik.http.routers.uptime-kuma.entrypoints=web,websecure" - "traefik.http.routers.uptime-kuma.rule=Host(`status.teknologiumum.com`)" - "traefik.http.routers.uptime-kuma.tls.certresolver=tlsresolver" @@ -37,6 +38,8 @@ services: options: max-size: 10M max-file: 3 + networks: + - public-web volumes: uptime-data: