-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
44 lines (35 loc) · 1 KB
/
Dockerfile
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
# Stage 1: Build the Go application
FROM golang:1.17 AS build
# Install any dependencies required for your Go application
WORKDIR /app
COPY go.mod .
COPY go.sum .
RUN go mod download
# Copy the rest of the application source code
COPY . .
# Build the Go application
RUN go build -o app .
# Stage 2: Final image
FROM debian:bullseye-slim
# Install ffmpeg and Python
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ffmpeg \
python3 \
git \
&& rm -rf /var/lib/apt/lists/*
# Install yt-dlp using pip
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3-pip \
&& pip3 install --no-cache-dir yt-dlp \
&& pip3 install git+https://github.com/openai/whisper.git \
&& apt-get purge -y python3-pip \
&& apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*
# Copy the built Go application from the previous stage
COPY --from=build /app/app /usr/local/bin/app
# Set the working directory
WORKDIR /root
# Run the application
CMD ["app"]