Files
tsrun/Dockerfile
T
dmgnr e588b9a527
Deploy tsrun / deploy (push) Failing after 15s
feat: add tsrun bootstrap service and deploy
2026-07-22 06:23:21 +00:00

33 lines
1.3 KiB
Docker

FROM golang:1.26-alpine AS go-builder
WORKDIR /app
RUN apk add --no-cache bash curl unzip upx
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN test -f secrets/tsrun.manifest.json
RUN curl -fsSL "https://www.wintun.net/builds/wintun-0.14.1.zip" -o /tmp/wintun.zip \
&& unzip -p /tmp/wintun.zip wintun/bin/amd64/wintun.dll > internal/runtime/full/wintun.dll
RUN go run ./cmd/buildblob -in secrets/tsrun.manifest.json -out internal/embedded/blob_gen.go
RUN GOOS=linux GOARCH=amd64 go build -trimpath -ldflags='-s -w -buildid=' -o /out/tsrun-linux ./cmd/tsrun
RUN GOOS=windows GOARCH=amd64 go build -trimpath -ldflags='-s -w -buildid=' -o /out/tsrun.exe ./cmd/tsrun
RUN cp /out/tsrun-linux /out/tsrun-linux-upx && upx --best --lzma /out/tsrun-linux-upx
RUN cp /out/tsrun.exe /out/tsrun-upx.exe && upx --best --lzma /out/tsrun-upx.exe
FROM oven/bun:1.3.14-alpine AS bun-builder
WORKDIR /app
COPY server ./server
RUN bun build --target bun --outfile /out/server.js ./server/index.ts
FROM oven/bun:1.3.14-alpine
WORKDIR /app
COPY --from=bun-builder /out/server.js ./server.js
COPY --from=go-builder /out/tsrun-linux ./dist/tsrun-linux
COPY --from=go-builder /out/tsrun-linux-upx ./dist/tsrun-linux-upx
COPY --from=go-builder /out/tsrun.exe ./dist/tsrun.exe
COPY --from=go-builder /out/tsrun-upx.exe ./dist/tsrun-upx.exe
EXPOSE 3000
CMD ["bun", "./server.js"]