Use watch mode for transcoder

This commit is contained in:
Zoe Roux 2025-05-19 14:10:35 +02:00
parent fca0d8d7ea
commit 9ef53d06bd
No known key found for this signature in database
4 changed files with 18 additions and 6 deletions

View File

@ -15,10 +15,14 @@ x-transcoder: &transcoder-base
environment:
- GOCODER_PREFIX=/video
volumes:
- ./transcoder:/app
- ${LIBRARY_ROOT}:/video:ro
- ${CACHE_ROOT}:/cache
- transcoder_metadata:/metadata
develop:
watch:
- action: sync+restart
path: ./transcoder
target: /app
services:
# front:

View File

@ -1 +1,7 @@
target/
**
!/go.mod
!/go.sum
!/**.go
!/migrations
# genereated via swag
!/docs

View File

@ -24,11 +24,13 @@ RUN apt-get update \
ffmpeg libavformat-dev libavutil-dev libswscale-dev \
&& apt-get clean autoclean -y \
&& apt-get autoremove -y
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build -o ./transcoder
RUN GOOS=linux go build -o ./transcoder
# debian is required for nvidia hardware acceleration
# we use trixie (debian's testing because ffmpeg on latest is v5 and we need v6)

View File

@ -22,8 +22,6 @@ RUN set -eux; \
ENV SSL_CERT_DIR=/etc/ssl/certs
RUN update-ca-certificates
RUN go install github.com/bokwoon95/wgo@latest
# read target arch from buildx or default to amd64 if using legacy builder.
ARG TARGETARCH
ENV TARGETARCH=${TARGETARCH:-amd64}
@ -51,5 +49,7 @@ ENV NVIDIA_DRIVER_CAPABILITIES="all"
COPY go.mod go.sum ./
RUN go mod download
COPY . .
EXPOSE 7666
CMD ["wgo", "run", "-race", "."]
CMD ["go", "run", "-race", "."]