-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
53 lines (38 loc) · 1.31 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
45
46
47
48
49
50
51
52
53
FROM node:19 AS frontend-builder
WORKDIR /usr/src/pomu
COPY . .
# install yarn
RUN corepack enable && \
corepack prepare yarn@stable --activate
# build frontend files
RUN yarn install --immutable --immutable-cache && \
yarn build
FROM golang:1.18 AS backend-builder
WORKDIR /usr/src/pomu
COPY . .
# build backend
RUN chmod +x build.sh && ./build.sh
FROM ubuntu:jammy
# update apt mirrors
RUN apt-get update
# install runtime dependencies for youtube-dl
RUN apt-get install -y --no-install-recommends python3 curl ca-certificates
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10 # set python3 as `python`
# direct pomu dependency: ffmpeg
RUN apt-get install -y --no-install-recommends ffmpeg
ENV FFMPEG="/usr/bin/ffmpeg"
# cleanup apt
RUN apt-get clean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
# direct pomu dependency: yt-dlp
RUN curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux -o /usr/local/bin/yt-dlp
RUN chmod +x /usr/local/bin/yt-dlp
ENV YT_DLP="/usr/local/bin/yt-dlp"
WORKDIR /app/
COPY --from=frontend-builder /usr/src/pomu/dist /app/dist
COPY --from=backend-builder /usr/src/pomu/migrations /app/migrations
COPY --from=backend-builder /usr/src/pomu/pomu /app/
EXPOSE 8080
ENV BIND_ADDRESS="0.0.0.0:8080"
ENTRYPOINT ["/app/pomu"]