dockerfile: Pass '-Ddisable_quic' to 'crystal build' (#3376)

+ use alpine 3.16 as a base like the crystal team
This commit is contained in:
Samantaz Fox
2022-11-01 17:34:26 +00:00
committed by GitHub
parent 84cd4d6a5b
commit 758b7df400
3 changed files with 48 additions and 6 deletions

View File

@@ -2,6 +2,7 @@ FROM crystallang/crystal:1.4.1-alpine AS builder
RUN apk add --no-cache sqlite-static yaml-static
ARG release
ARG disable_quic
WORKDIR /invidious
COPY ./shard.yml ./shard.yml
@@ -23,7 +24,13 @@ COPY ./videojs-dependencies.yml ./videojs-dependencies.yml
RUN crystal spec --warnings all \
--link-flags "-lxml2 -llzma"
RUN if [ "${release}" == 1 ] ; then \
RUN if [[ "${release}" == 1 && "${disable_quic}" == 1 ]] ; then \
crystal build ./src/invidious.cr \
--release \
-Ddisable_quic \
--static --warnings all \
--link-flags "-lxml2 -llzma"; \
elif [[ "${release}" == 1 ]] ; then \
crystal build ./src/invidious.cr \
--release \
--static --warnings all \
@@ -35,7 +42,7 @@ RUN if [ "${release}" == 1 ] ; then \
fi
FROM alpine:latest
FROM alpine:3.16
RUN apk add --no-cache librsvg ttf-opensans
WORKDIR /invidious
RUN addgroup -g 1000 -S invidious && \