|
1 | 1 | # TODO: change from ffmpeg 5.1+ to yt-dlp/FFmpeg
|
2 |
| -FROM jrottenberg/ffmpeg:5.1-alpine as ffmpeg |
| 2 | +FROM jrottenberg/ffmpeg:5.1-alpine AS ffmpeg |
3 | 3 |
|
4 |
| -FROM alpine:latest as sanjuuni |
| 4 | +FROM alpine:3.17.0 as sanjuuni |
5 | 5 |
|
6 | 6 | # TODO: use the same ffmpeg for sanjuuni
|
7 |
| -RUN set -x \ |
8 |
| - && apk add --no-cache --update git g++ zlib-dev poco-dev make ffmpeg-dev \ |
9 |
| - && git clone https://github.com/MCJack123/sanjuuni.git |
| 7 | +RUN set -eux; \ |
| 8 | + apk add --no-cache --update g++ zlib-dev poco-dev make ffmpeg-dev; \ |
| 9 | + wget -O sanjuuni.tar.gz https://github.com/MCJack123/sanjuuni/archive/30dcabb4b56f1eb32c88e1bce384b0898367ebda.tar.gz; \ |
| 10 | + echo "029eb0e8853eccc74ea328bb5933678e60e2c56f03f321bf5f982643768b2877 *sanjuuni.tar.gz" | sha256sum -c -; \ |
| 11 | + mkdir -p sanjuuni; \ |
| 12 | + tar -xC sanjuuni --strip-components=1 -f sanjuuni.tar.gz; \ |
| 13 | + rm sanjuuni.tar.gz; |
10 | 14 |
|
11 | 15 | WORKDIR /sanjuuni
|
12 | 16 |
|
13 |
| -RUN set -x \ |
14 |
| - && ./configure \ |
15 |
| - && make |
| 17 | +RUN set -eux; \ |
| 18 | + ./configure; \ |
| 19 | + make |
16 | 20 |
|
17 |
| -FROM alpine:latest AS builder |
| 21 | +FROM ghcr.io/commandcracker/alpine-pypy3.9-pip:3.17.0-pypy-7.3.10-pip-22.3.1 AS builder |
18 | 22 |
|
19 | 23 | COPY requirements.txt .
|
20 | 24 | COPY youcube ./youcube
|
21 | 25 | COPY compile.py .
|
22 | 26 |
|
23 |
| -ENV \ |
24 |
| - # Make sure we use the virtualenv: |
25 |
| - PATH="/opt/venv/bin:$PATH" |
26 |
| - |
27 |
| -RUN set -x \ |
28 |
| - && apk add --no-cache --update python3 py3-pip gcc libc-dev \ |
29 |
| - # Create virtualenv |
30 |
| - && python3 -m venv /opt/venv \ |
31 |
| - && pip install --no-cache-dir --upgrade pip \ |
32 |
| - && pip install --no-cache-dir --use-pep517 -r requirements.txt \ |
33 |
| - && python3 compile.py |
| 27 | +RUN set -eux; \ |
| 28 | + apk add --no-cache --update gcc libc-dev libstdc++-dev; \ |
| 29 | + pip install --no-cache-dir --use-pep517 -r requirements.txt; \ |
| 30 | + python3 compile.py; \ |
| 31 | + pip uninstall pip -y |
34 | 32 |
|
35 |
| -FROM alpine:latest |
| 33 | +FROM alpine:3.17.0 |
36 | 34 |
|
37 | 35 | WORKDIR /opt/server
|
38 | 36 |
|
39 |
| -RUN set -x \ |
40 |
| - && apk add --no-cache --update python3 \ |
| 37 | +RUN set -eux; \ |
| 38 | + apk add --no-cache --update \ |
| 39 | + # pypy requirements |
| 40 | + libffi libbz2 \ |
41 | 41 | # ffmpeg requirements
|
42 | 42 | libgcc libstdc++ ca-certificates libcrypto1.1 libssl1.1 libgomp expat \
|
43 | 43 | # sanjuuni requirements
|
44 |
| - poco \ |
45 |
| - && chown 1000 /opt/server/ |
| 44 | + poco; \ |
| 45 | + chown 1000 /opt/server/ |
46 | 46 |
|
47 |
| -COPY --from=builder /opt/venv /opt/venv |
| 47 | +COPY --from=builder /opt/pypy /opt/pypy |
48 | 48 | # add ffmpeg
|
49 | 49 | COPY --from=ffmpeg /usr/local /usr/local
|
50 | 50 | # add sanjuuni
|
51 | 51 | COPY --from=sanjuuni /sanjuuni/sanjuuni /usr/local/bin
|
52 | 52 |
|
53 | 53 | ENV \
|
54 | 54 | # Make sure we use the virtualenv:
|
55 |
| - PATH="/opt/venv/bin:$PATH" \ |
| 55 | + PATH="/opt/pypy/bin:$PATH" \ |
56 | 56 | # Use ffmpeg libs
|
57 | 57 | LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 \
|
58 | 58 | # yt-dlp cache dir
|
|
0 commit comments