diff --git a/deploy/docker-compose-http3.yml b/deploy/docker-compose-http3.yml new file mode 100644 index 0000000000000000000000000000000000000000..0e1aa051918aabdc4721fa94db4dff3fa9bc447a --- /dev/null +++ b/deploy/docker-compose-http3.yml @@ -0,0 +1,27 @@ + +services: + gateway-api: + image: registry.cn-shenzhen.aliyuncs.com/tokengo/gateway-api + restart: always + container_name: gateway-api + build: + context: ../src + dockerfile: Gateway/Dockerfile-http3 + ports: + - 8200:8080 + - 8300:8081/udp + - 8300:8081/tcp + volumes: + - ./data:/data/ + + gateway-web: + image: registry.cn-shenzhen.aliyuncs.com/tokengo/gateway-web + restart: always + build: + context: ../web + dockerfile: Dockerfile + privileged: true + environment: + api_url: http://localhost:8200 + ports: + - 10800:80 diff --git a/docker-compose.yml b/deploy/docker-compose.yml similarity index 92% rename from docker-compose.yml rename to deploy/docker-compose.yml index 58efa33a7f1a646f32808c07fc41e35c199b6482..5ef3ea3f63998ea36dfb68bf860c4ac18761309e 100644 --- a/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -5,7 +5,7 @@ services: restart: always container_name: gateway-api build: - context: ./src + context: ../src dockerfile: Gateway/Dockerfile ports: - 8200:8080 @@ -17,7 +17,7 @@ services: image: registry.cn-shenzhen.aliyuncs.com/tokengo/gateway-web restart: always build: - context: ./web + context: ../web dockerfile: Dockerfile privileged: true environment: diff --git a/src/Gateway/Dockerfile-http3 b/src/Gateway/Dockerfile-http3 new file mode 100644 index 0000000000000000000000000000000000000000..fe9886241ed83f597cfafa550d18c8303b7a5ff9 --- /dev/null +++ b/src/Gateway/Dockerfile-http3 @@ -0,0 +1,31 @@ +FROM mcr.microsoft.com/dotnet/aspnet:8.0.1-bookworm-slim-amd64 AS base +USER root +RUN apt update \ + && apt-get install -y --no-install-recommends curl \ + && curl -sSL -O https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb \ + && dpkg -i packages-microsoft-prod.deb \ + && rm packages-microsoft-prod.deb \ + && apt-get update \ + && apt-get install -y libmsquic \ + && apt-get purge -y --auto-remove wget && apt-get clean && rm -rf /var/lib/apt/lists/* +WORKDIR /app +EXPOSE 8080 +EXPOSE 8081 + +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["src/Gateway/Gateway.csproj", "src/Gateway/"] +RUN dotnet restore "./src/Gateway/Gateway.csproj" +COPY . . +WORKDIR "/src/src/Gateway" +RUN dotnet build "./Gateway.csproj" -c $BUILD_CONFIGURATION -o /app/build + +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./Gateway.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Gateway.dll"] \ No newline at end of file