mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2026-02-14 04:26:29 +00:00
omg bruh I don't care anymore kms
This commit is contained in:
@@ -1,34 +1,20 @@
|
|||||||
# https://github.com/openssl/openssl/releases/tag/openssl-3.5.2
|
# https://github.com/openssl/openssl/releases/tag/openssl-3.5.2
|
||||||
ARG OPENSSL_VERSION='3.5.2'
|
ARG OPENSSL_VERSION='3.5.2'
|
||||||
ARG OPENSSL_SHA256='c53a47e5e441c930c3928cf7bf6fb00e5d129b630e0aa873b08258656e7345ec'
|
|
||||||
|
|
||||||
FROM mirror.gcr.io/84codes/crystal:1.18.2-alpine AS dependabot-crystal
|
FROM mirror.gcr.io/84codes/crystal:1.18.2-alpine AS builder
|
||||||
|
|
||||||
# We compile openssl ourselves due to a memory leak in how crystal interacts
|
|
||||||
# with openssl
|
|
||||||
# Reference: https://github.com/iv-org/invidious/issues/1438#issuecomment-3087636228
|
|
||||||
FROM dependabot-crystal AS openssl-builder
|
|
||||||
RUN apk add --no-cache curl perl linux-headers
|
|
||||||
|
|
||||||
WORKDIR /
|
|
||||||
|
|
||||||
ARG OPENSSL_VERSION
|
|
||||||
ARG OPENSSL_SHA256
|
|
||||||
RUN curl -Ls "https://github.com/openssl/openssl/releases/download/openssl-${OPENSSL_VERSION}/openssl-${OPENSSL_VERSION}.tar.gz" --output openssl-${OPENSSL_VERSION}.tar.gz
|
|
||||||
RUN echo "${OPENSSL_SHA256} openssl-${OPENSSL_VERSION}.tar.gz" | sha256sum -c
|
|
||||||
RUN tar -xzvf openssl-${OPENSSL_VERSION}.tar.gz
|
|
||||||
|
|
||||||
RUN cd openssl-${OPENSSL_VERSION} && ./Configure --openssldir=/etc/ssl && make -j$(nproc)
|
|
||||||
|
|
||||||
FROM dependabot-crystal AS builder
|
|
||||||
|
|
||||||
RUN apk add --no-cache sqlite-static yaml-static
|
RUN apk add --no-cache sqlite-static yaml-static
|
||||||
RUN apk del openssl-dev openssl-libs-static
|
RUN apk del openssl-dev openssl-libs-static
|
||||||
|
RUN apk add curl perl linux-headers
|
||||||
|
|
||||||
ARG release
|
ARG release
|
||||||
|
|
||||||
WORKDIR /invidious
|
WORKDIR /invidious
|
||||||
|
|
||||||
|
ARG OPENSSL_VERSION
|
||||||
|
RUN curl -Ls "https://github.com/openssl/openssl/releases/download/openssl-${OPENSSL_VERSION}/openssl-${OPENSSL_VERSION}.tar.gz" | tar xz
|
||||||
|
RUN cd openssl-${OPENSSL_VERSION} && ./Configure --openssldir=/etc/ssl && make -j
|
||||||
|
|
||||||
COPY ./shard.yml ./shard.yml
|
COPY ./shard.yml ./shard.yml
|
||||||
COPY ./shard.lock ./shard.lock
|
COPY ./shard.lock ./shard.lock
|
||||||
|
|
||||||
@@ -44,24 +30,12 @@ COPY ./scripts/ ./scripts/
|
|||||||
COPY ./assets/ ./assets/
|
COPY ./assets/ ./assets/
|
||||||
COPY ./videojs-dependencies.yml ./videojs-dependencies.yml
|
COPY ./videojs-dependencies.yml ./videojs-dependencies.yml
|
||||||
|
|
||||||
RUN crystal spec --warnings all \
|
RUN --mount=type=cache,target=/root/.cache/crystal \
|
||||||
--link-flags "-lxml2 -llzma"
|
PKG_CONFIG_PATH=$PWD/openssl-${OPENSSL_VERSION} \
|
||||||
|
|
||||||
ARG OPENSSL_VERSION
|
|
||||||
COPY --from=openssl-builder /openssl-${OPENSSL_VERSION} /openssl-${OPENSSL_VERSION}
|
|
||||||
|
|
||||||
RUN --mount=type=cache,target=/root/.cache/crystal if [[ "${release}" == 1 ]] ; then \
|
|
||||||
PKG_CONFIG_PATH=/openssl-${OPENSSL_VERSION} \
|
|
||||||
crystal build ./src/invidious.cr \
|
crystal build ./src/invidious.cr \
|
||||||
--release -s -p -t --mcpu=x86-64-v2 \
|
--release -s -p -t --mcpu=x86-64-v2 \
|
||||||
--static --warnings all \
|
--static --warnings all \
|
||||||
--link-flags "-lxml2 -llzma"; \
|
--link-flags "-lxml2 -llzma";
|
||||||
else \
|
|
||||||
PKG_CONFIG_PATH=/openssl-${OPENSSL_VERSION} \
|
|
||||||
crystal build ./src/invidious.cr \
|
|
||||||
--static --warnings all \
|
|
||||||
--link-flags "-lxml2 -llzma"; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
FROM mirror.gcr.io/alpine:3.23
|
FROM mirror.gcr.io/alpine:3.23
|
||||||
RUN apk add --no-cache rsvg-convert ttf-opensans tini tzdata
|
RUN apk add --no-cache rsvg-convert ttf-opensans tini tzdata
|
||||||
|
|||||||
Reference in New Issue
Block a user