-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
36 lines (26 loc) · 1.4 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
FROM node:18
# Set the working directory to /app
WORKDIR /app
# Install mecab and mecab-ipadic-neologd
RUN apt-get update && apt-get install -y mecab libmecab-dev mecab-ipadic-utf8 git make curl xz-utils file ffmpeg
# Make sudo dummy replacement, so we don't weaken docker security
RUN echo "#!/bin/bash\n\$@" > /usr/bin/sudo
RUN chmod +x /usr/bin/sudo
RUN git clone --depth 1 https://github.com/neologd/mecab-ipadic-neologd.git /tmp/neologd && \
/tmp/neologd/bin/install-mecab-ipadic-neologd -n -a -y && \
rm -rf /tmp/neologd
# Install Python 3 and dependencies
RUN apt-get install -y python3 python3-pip
RUN pip3 install yt-dlp https://github.com/coletdjnz/yt-dlp-youtube-oauth2/archive/refs/heads/master.zip --break-system-packages
RUN echo 'machine youtube login oauth2 password ""' > /etc/netrc.txt
RUN echo '--netrc --netrc-location /etc/netrc.txt' > /etc/yt-dlp.conf
RUN npm install -g concurrently
COPY mecabrc /etc/
ENV YTDLP_PATH=/usr/local/bin/yt-dlp
ENV MUSIC_FILES_PATH=/var/music/
ENV NODE_ENV production
# Expose the ports defined in the environment variables LYRICOVA_PORT and JUKEBOX_PORT
EXPOSE $LYRICOVA_PORT $JUKEBOX_PORT
VOLUME ["/app", "/var/music"]
# Start the website in the lyricova and jukebox packages concurrently
CMD ["concurrently", "-n", "lyricova,jukebox", "-c", "green,blue", "--restart-tries", "-1", "cd packages/lyricova && npm run serve", "cd packages/jukebox && npm run serve"]