-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
62 lines (44 loc) · 1.74 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
54
55
56
57
58
59
60
61
62
FROM archlinux:base as init
RUN pacman -Sy --needed --noconfirm openssl reflector && reflector --save /etc/pacman.d/mirrorlist && \
pacman -Syu --needed --noconfirm libc++ postgresql-libs libsodium opus ffmpeg
FROM init as build
# Build dependencies
WORKDIR /app
# Copy source files
COPY include ./include
COPY src ./src
COPY libs ./libs
COPY CMakeLists.txt ./
# Install dependencies
RUN pacman -Syu --needed --noconfirm base-devel libc++ git cmake libsodium opus postgresql-libs clang
RUN mkdir -p build && cd build && \
export CC=clang && \
export CXX=clang++ && \
export LDFLAGS='-flto -stdlib=libc++ -lc++' && \
export CFLAGS='-flto' && \
export CXXFLAGS='-flto -stdlib=libc++' && \
cmake .. -DDPP_BUILD_TEST=OFF -DRUN_LDCONFIG=OFF -DDPP_NO_VCPKG=ON -DDPP_USE_EXTERNAL_JSON=ON && make all -j12
# cmake -DCOMPILE_GNUPLOT=ON .. && make all -j12
FROM init as deploy
RUN groupadd musicat && useradd -m -g musicat musicat
USER musicat
WORKDIR /home/musicat
COPY --chown=musicat:musicat --from=build \
/app/build/Shasha \
/app/build/libs/DPP/library/libdpp.so* \
/app/libs/curlpp/build/libcurlpp.so* \
/app/libs/icu/usr/local/lib/lib* \
/app/build/libs/ogg/libogg.so* \
/app/src/yt-dlp/ytdlp.py \
/home/musicat/
# /app/libs/gnuplot-*/build/bin/gnuplot \
COPY --chown=musicat:musicat --from=build \
/app/libs/yt-dlp \
/home/musicat/yt-dlp/
COPY --chown=musicat:musicat --from=build \
/app/src/yt-dlp/utils \
/home/musicat/utils/
ENV LD_LIBRARY_PATH=/home/musicat
VOLUME ["/home/musicat/music"]
# config for container create `-v` switch: /home/musicat/sha_conf.json
CMD ./Shasha