-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (25 loc) · 764 Bytes
/
Dockerfile
File metadata and controls
39 lines (25 loc) · 764 Bytes
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
# syntax=docker/dockerfile:1
FROM golang:1.24-alpine AS builder
WORKDIR /app
RUN apk add --no-cache ca-certificates tzdata
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o /out/downaria-api ./cmd/server
FROM alpine:3.19
WORKDIR /app
RUN apk add --no-cache \
ca-certificates \
tzdata \
ffmpeg \
python3 \
py3-pip \
curl \
&& pip3 install --no-cache-dir --break-system-packages yt-dlp \
&& rm -rf /var/cache/apk/*
COPY --from=builder /out/downaria-api /app/downaria-api
ENV PORT=8081
EXPOSE 8081
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD curl -fsS http://127.0.0.1:${PORT}/health || exit 1
CMD ["/app/downaria-api"]