1
- FROM crystallang /crystal:1.16.3-alpine AS builder
1
+ FROM 84codes /crystal:1.16.3-debian-12 AS builder
2
2
3
- RUN apk add --no-cache sqlite-static yaml-static
3
+ RUN apt update && \
4
+ apt install -y --no-install-recommends liblzma-dev libsqlite3-dev
4
5
5
6
ARG release
6
7
@@ -24,19 +25,23 @@ RUN crystal spec --warnings all \
24
25
RUN --mount=type=cache,target=/root/.cache/crystal if [[ "${release}" == 1 ]] ; then \
25
26
crystal build ./src/invidious.cr \
26
27
--release \
27
- --static -- warnings all \
28
+ --warnings all \
28
29
--link-flags "-lxml2 -llzma" ; \
29
30
else \
30
31
crystal build ./src/invidious.cr \
31
- --static -- warnings all \
32
+ --warnings all \
32
33
--link-flags "-lxml2 -llzma" ; \
33
34
fi
34
35
35
- FROM alpine:3.21
36
- RUN apk add --no-cache rsvg-convert ttf-opensans tini tzdata
36
+ FROM debian:12-slim
37
+ RUN apt update && \
38
+ DEBIAN_FRONTEND=noninteractive \
39
+ apt install -y --no-install-recommends \
40
+ librsvg2-bin fonts-open-sans tini tzdata \
41
+ libyaml-0-2 libsqlite3-0 libssl3 liblzma5 ca-certificates
37
42
WORKDIR /invidious
38
- RUN addgroup -g 1000 -S invidious && \
39
- adduser -u 1000 -S invidious -G invidious
43
+ RUN groupadd --gid 1000 --system invidious && \
44
+ useradd --uid 1000 --system invidious -g invidious
40
45
COPY --chown=invidious ./config/config.* ./config/
41
46
RUN mv -n config/config.example.yml config/config.yml
42
47
RUN sed -i 's/host: \( 127.0.0.1\| localhost\) /host: invidious-db/' config/config.yml
@@ -45,8 +50,11 @@ COPY ./locales/ ./locales/
45
50
COPY --from=builder /invidious/assets ./assets/
46
51
COPY --from=builder /invidious/invidious .
47
52
RUN chmod o+rX -R ./assets ./config ./locales
53
+ RUN apt-get clean autoclean && \
54
+ apt-get autoremove --yes && \
55
+ rm -rf /var/lib/apt /var/lib/dpkg /var/lib/cache /var/lib/log
48
56
49
57
EXPOSE 3000
50
58
USER invidious
51
- ENTRYPOINT ["/sbin /tini" , "--" ]
59
+ ENTRYPOINT ["/usr/bin /tini" , "--" ]
52
60
CMD [ "/invidious/invidious" ]
0 commit comments