-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.min
57 lines (49 loc) · 1.51 KB
/
Dockerfile.min
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
FROM docker.io/library/alpine:3.18.5@sha256:34871e7290500828b39e22294660bee86d966bc0017544e848dd9a255cdf59e0 AS builder
RUN apk add --no-cache 'crystal=1.8.2-r0' \
shards \
sqlite-static \
yaml-static \
yaml-dev \
libxml2-static \
zlib-static \
openssl-libs-static \
openssl-dev \
musl-dev \
xz-static
WORKDIR /invidious
COPY shard.yml shard.lock ./
RUN shards install
COPY . .
ARG release=1
RUN crystal spec --release \
--warnings all \
--link-flags "-lxml2 -llzma"
RUN if [ "$release" == 1 ] ; then \
crystal build ./src/invidious.cr \
--static \
--release \
--warnings all \
--link-flags "-lxml2 -llzma"; \
else \
crystal build ./src/invidious.cr \
--static \
--warnings all \
--link-flags "-lxml2 -llzma"; \
fi
FROM gcr.io/distroless/static-debian12@sha256:5c7e2b465ac6a2a4e5f4f7f722ce43b147dabe87cb21ac6c4007ae5178a1fa58 AS release
# RUN apk add --no-cache librsvg ttf-opensans tini
WORKDIR /invidious
# RUN addgroup -g 1000 -S invidious && \
# adduser -u 1000 -S invidious -G invidious
# Copy config
COPY --chown=1000 config/config.example.yml config/config.yml
# Get invidious
COPY --from=builder /invidious/invidious ./
COPY --from=builder /invidious/assets assets
COPY --from=builder /invidious/locales locales
COPY --from=builder /invidious/config/sql config/sql
# RUN chmod o+rX -R ./assets ./config ./locales
EXPOSE 3000
USER 1000
# ENTRYPOINT ["/sbin/tini", "--"]
CMD [ "/invidious/invidious" ]