-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
60 lines (45 loc) · 1.44 KB
/
Dockerfile
File metadata and controls
60 lines (45 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM golang:1.25-alpine AS build
WORKDIR /app
RUN apk add --no-cache tzdata
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/go/pkg/mod \
go mod download
RUN --mount=type=cache,target=/go/pkg/mod \
go install github.com/swaggo/swag/cmd/[email protected]
COPY . .
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
/go/bin/swag init -g internal/modules/rest/rest.go -o docs
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go build -v -o bilirec
FROM alpine:latest
WORKDIR /app
RUN apk update && \
apk add --no-cache ffmpeg \
&& rm -rf /var/cache/apk/*
COPY --from=build /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=build /app/bilirec .
COPY --from=build /app/docs ./docs
RUN chmod +x ./bilirec
ENV TZ=Asia/Hong_Kong
ENV ANONYMOUS_LOGIN=false \
PORT=8080 \
MAX_CONCURRENT_RECORDINGS=3 \
MAX_RECORDING_HOURS=5 \
MAX_RECOVERY_ATTEMPTS=5 \
OUTPUT_DIR=records \
DATABASE_DIR=database \
CONVERT_FLV_TO_MP4=false \
DELETE_FLV_AFTER_CONVERT=false \
CLOUDCONVERT_THRESHOLD=1073741824 \
MIN_DISK_SPACE_BYTES=5368709120 \
FRONTEND_URL=http://localhost:8080 \
BACKEND_HOST=localhost:8080 \
UPLOAD_BUFFER_SIZE=5242880 \
DOWNLOAD_BUFFER_SIZE=5242880 \
STREAM_WRITER_BUFFER_SIZE=1048576 \
LIVE_STREAM_WRITER_BUFFER_SIZE=5242880
ENV GOMEMLIMIT=256MiB
ENV GOGC=50
ENTRYPOINT ["./bilirec"]