reviewed dockerfile
This commit is contained in:
33
Dockerfile
33
Dockerfile
@@ -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
|
# folder structure
|
||||||
WORKDIR /usr/src/yt-dlp-webui/downloads
|
|
||||||
VOLUME /downloads
|
|
||||||
WORKDIR /usr/src/yt-dlp-webui
|
WORKDIR /usr/src/yt-dlp-webui
|
||||||
# install core dependencies
|
# install core dependencies
|
||||||
RUN apk update
|
RUN apk update && \
|
||||||
RUN apk add curl wget psmisc ffmpeg nodejs npm go yt-dlp
|
apk add curl wget psmisc ffmpeg nodejs yarn go yt-dlp
|
||||||
# copy srcs
|
# copia la salsa
|
||||||
COPY . .
|
COPY . .
|
||||||
# install node dependencies
|
# build frontend
|
||||||
WORKDIR /usr/src/yt-dlp-webui/frontend
|
WORKDIR /usr/src/yt-dlp-webui/frontend
|
||||||
RUN npm i
|
RUN yarn install && \
|
||||||
RUN npm run build
|
yarn build
|
||||||
# install go dependencies
|
# build backend + incubator
|
||||||
WORKDIR /usr/src/yt-dlp-webui
|
WORKDIR /usr/src/yt-dlp-webui
|
||||||
RUN go build -o 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
|
EXPOSE 3033
|
||||||
CMD [ "./yt-dlp-webui" , "--out", "/downloads" ]
|
CMD [ "/usr/bin/yt-dlp-webui" , "--out", "/downloads" ]
|
||||||
|
|||||||
2
go.mod
2
go.mod
@@ -9,6 +9,7 @@ require (
|
|||||||
github.com/google/uuid v1.3.0
|
github.com/google/uuid v1.3.0
|
||||||
github.com/marcopeocchi/fazzoletti v0.0.0-20221114144444-1e802380a7db
|
github.com/marcopeocchi/fazzoletti v0.0.0-20221114144444-1e802380a7db
|
||||||
golang.org/x/sys v0.4.0
|
golang.org/x/sys v0.4.0
|
||||||
|
gopkg.in/yaml.v3 v3.0.1
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
@@ -23,5 +24,4 @@ require (
|
|||||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||||
github.com/valyala/fasthttp v1.43.0 // indirect
|
github.com/valyala/fasthttp v1.43.0 // indirect
|
||||||
github.com/valyala/tcplisten v1.0.0 // indirect
|
github.com/valyala/tcplisten v1.0.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
|
||||||
)
|
)
|
||||||
|
|||||||
1
go.sum
1
go.sum
@@ -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.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
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=
|
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/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 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
|
|||||||
Reference in New Issue
Block a user