-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (23 loc) · 823 Bytes
/
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
FROM golang:1.21-alpine
RUN apk upgrade
RUN apk add --no-cache curl
# install yt-dlp
RUN curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp
RUN chmod a+rx /usr/local/bin/yt-dlp
# install dependencies
RUN apk update \ && apk add python3-dev
RUN ln -s /usr/bin/python3 /usr/local/bin/python
# Set the Current Working Directory inside the container
WORKDIR /usr/app
# Copy the go.mod and go.sum files
COPY go.* ./
# Download all the dependencies
RUN go mod download
# Copy everything from the current directory to the PWD (Present Working Directory) inside the container
COPY . ./
# Build the Go app
RUN go build -o YoutubeSubtitles ./cmd/server/main.go
# This container exposes port 8080 to the outside world
EXPOSE 8080
# Run the executable
CMD ["./YoutubeSubtitles"]