update dockerfile and docker compose file
Some checks failed
CI / build (push) Failing after 31s

This commit is contained in:
Fijxu 2024-12-20 17:12:17 -03:00
parent 03a37009c4
commit 0a4dd54393
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4
2 changed files with 19 additions and 23 deletions

View file

@ -1,4 +1,4 @@
FROM golang:alpine AS build
FROM golang:alpine3.21 AS build
WORKDIR /app/
@ -10,7 +10,9 @@ COPY . .
RUN --mount=type=cache,target=/root/.cache/go-build \
go build -ldflags "-s -w -X 'main.version=$(date '+%Y-%m-%d')-$(git rev-list --abbrev-commit -1 HEAD)'"
FROM alpine:edge
FROM alpine:3.21
RUN adduser -u 10001 -S appuser
RUN apk add --no-cache libwebp
@ -18,4 +20,7 @@ WORKDIR /app/
COPY --from=build /app/http3-ytproxy /app/http3-ytproxy
CMD ./http3-ytproxy -l 0.0.0.0
# Switch to non-privileged user
USER appuser
ENTRYPOINT ["/app/http3-ytproxy"]

View file

@ -1,13 +1,12 @@
# Docker compose file for http3-proxy used in Invidious
# IMPORTANT: Create the docker network manually before using gluetun
# sudo docker network create --subnet=172.80.0.0/16 gluetun-http3-ytproxy
# Docker compose file for http3-ytproxy used in inv.nadeko.net
services:
http3-proxy:
build: .
image: git.nadeko.net/fijxu/http3-ytproxy:latest
restart: always
# Uncomment this IF YOU ARE using gluetun!
network_mode: "service:gluetun"
# network_mode: "service:gluetun"
# Uncomment this IF YOU ARE NOT using gluetun!
# ports:
# - "0.0.0.0:8443:8443/tcp" # HTTP/2
@ -16,10 +15,16 @@ services:
volumes:
- ./key.key:/data/key.key:ro
- ./fullchain.pem:/data/cert.pem:ro
command: "./http3-ytproxy -l 0.0.0.0 -p 8443 -https"
depends_on:
- gluetun
gluetun:
condition: service_healthy
# Needed for HTTP/3, otherwise, quic-go will output this depending of the machine:
# "failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 7168 kiB, got: 416 kiB).
# See https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes for details."
cap_add:
- NET_ADMIN
# You can comment this whole service if you are not going to use Gluetun at all
gluetun:
image: qmcgaw/gluetun:latest
restart: always
@ -37,17 +42,3 @@ services:
- /dev/net/tun:/dev/net/tun
volumes:
- ./gluetun:/gluetun
environment:
- VPN_SERVICE_PROVIDER="${VPN_PROVIDER}"
- VPN_TYPE=wireguard
- WIREGUARD_PRIVATE_KEY="${WIREGUARD_KEY}"
- WIREGUARD_ADDRESSES="${WIREGUARD_ADDRESSES}"
- SERVER_HOSTNAMES="${SERVER_HOSTNAMES}"
# Use system DNS (Setup a caching DNS server!)
- DNS_KEEP_NAMESERVER=on
networks:
gluetun-http3-ytproxy:
networks:
gluetun-http3-ytproxy:
external: true