forked from coming-chat/IPFS-Upload-Relay
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (28 loc) · 819 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
34
35
36
37
38
39
40
41
42
FROM golang:alpine AS Builder
# Set the Current Working Directory inside the container
WORKDIR /app
# Install basic packages
RUN apk add \
gcc \
g++ \
curl
# Download ytdl
RUN curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /app/youtube-dl
# Copy everything from the current directory to the PWD (Present Working Directory) inside the container
COPY . .
# Download all the dependencies
RUN go mod download
# Build image
RUN go build .
FROM alpine AS Runner
# We need python for youtube-dl
WORKDIR /app
COPY --from=Builder /app/IPFS-Upload-Relay /app/app
COPY --from=Builder /app/youtube-dl /app/youtube-dl
# Set correct attribte
RUN chmod a+rx /app/youtube-dl
# This container exposes port 8080 to the outside world
EXPOSE 8080/tcp
ENV MODE=prod
# Run the executable
CMD ["/app/app"]