reviewed dockerfile

This commit is contained in:
2023-01-20 19:39:09 +01:00
parent 0c737b2a3e
commit 570b9eb2da
3 changed files with 23 additions and 13 deletions

View File

@@ -1,20 +1,29 @@
FROM alpine:3.17
# Multi stage build Dockerfile
# There's no point in using the edge (development branch of alpine)
FROM alpine:3.17 AS build
# folder structure
WORKDIR /usr/src/yt-dlp-webui/downloads
VOLUME /downloads
WORKDIR /usr/src/yt-dlp-webui
# install core dependencies
RUN apk update
RUN apk add curl wget psmisc ffmpeg nodejs npm go yt-dlp
# copy srcs
RUN apk update && \
apk add curl wget psmisc ffmpeg nodejs yarn go yt-dlp
# copia la salsa
COPY . .
# install node dependencies
# build frontend
WORKDIR /usr/src/yt-dlp-webui/frontend
RUN npm i
RUN npm run build
# install go dependencies
RUN yarn install && \
yarn build
# build backend + incubator
WORKDIR /usr/src/yt-dlp-webui
RUN go build -o yt-dlp-webui
# expose and run
FROM alpine:3.17
WORKDIR /usr/src/yt-dlp-webui/downloads
VOLUME /downloads
COPY --from=build /usr/src/yt-dlp-webui /usr/bin/yt-dlp-webui
EXPOSE 3033
CMD [ "./yt-dlp-webui" , "--out", "/downloads" ]
CMD [ "/usr/bin/yt-dlp-webui" , "--out", "/downloads" ]

2
go.mod
View File

@@ -9,6 +9,7 @@ require (
github.com/google/uuid v1.3.0
github.com/marcopeocchi/fazzoletti v0.0.0-20221114144444-1e802380a7db
golang.org/x/sys v0.4.0
gopkg.in/yaml.v3 v3.0.1
)
require (
@@ -23,5 +24,4 @@ require (
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasthttp v1.43.0 // indirect
github.com/valyala/tcplisten v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

1
go.sum
View File

@@ -56,6 +56,7 @@ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuX
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=