Fix TorrServer binary compilation and execution

This commit is contained in:
2025-10-31 21:21:49 +02:00
parent abd57d2811
commit d673187681
2 changed files with 9 additions and 7 deletions

View File

@@ -20,22 +20,20 @@ RUN yarn run build
### BUILD TORRSERVER START ###
FROM --platform=$BUILDPLATFORM golang:1.24-alpine AS builder
FROM golang:1.23-alpine AS builder
COPY . /opt/src
COPY --from=front /app/build /opt/src/web/build
WORKDIR /opt/src
ARG TARGETARCH
ENV GOARCH=$TARGETARCH
RUN apk add --update g++ \
&& go run gen_web.go \
&& cd server \
&& go mod tidy \
&& go clean -i -r -cache \
&& go build -ldflags '-w -s' -o "torrserver" ./cmd
&& CGO_ENABLED=1 go build -ldflags '-w -s' -o "torrserver" ./cmd \
&& chmod +x torrserver
### BUILD TORRSERVER END ###
@@ -48,11 +46,14 @@ RUN apt-get update && apt-get install -y \
ca-certificates \
supervisor \
nginx \
file \
&& rm -rf /var/lib/apt/lists/*
# Copy TorrServer binary
COPY --from=builder /opt/src/server/torrserver /usr/bin/torrserver
RUN chmod +x /usr/bin/torrserver
RUN chmod +x /usr/bin/torrserver \
&& ls -lah /usr/bin/torrserver \
&& file /usr/bin/torrserver
# Create directories
RUN mkdir -p /config/jellyfin \

View File

@@ -13,7 +13,8 @@ stderr_logfile=/var/log/supervisor/jellyfin_error.log
priority=1
[program:torrserver]
command=/usr/bin/torrserver --port 8090 --path /config/torrserver
command=/usr/bin/torrserver
environment=GODEBUG="madvdontneed=1"
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/torrserver.log