-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.debian
51 lines (41 loc) · 1.55 KB
/
Dockerfile.debian
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
FROM docker.io/library/debian:12@sha256:17122fe3d66916e55c0cbd5bbf54bb3f87b3582f4d86a755a0fd3498d360f91b AS builder
RUN apt-get update
RUN apt-get install curl git liblzma-dev libsqlite3-dev -y
RUN curl -fsSL https://crystal-lang.org/install.sh | bash -s -- --version=1.8
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 \
--release \
--warnings all \
--link-flags "-lxml2 -llzma"; \
else \
crystal build ./src/invidious.cr \
--warnings all \
--link-flags "-lxml2 -llzma"; \
fi
FROM docker.io/library/debian:12@sha256:17122fe3d66916e55c0cbd5bbf54bb3f87b3582f4d86a755a0fd3498d360f91b AS release
RUN apt-get update && \
apt-get install libxml2 librsvg2-bin libyaml-0-2 libsqlite3-0 openssl libevent-2.1-7 tini -y
WORKDIR /invidious
RUN groupadd invidious && \
useradd invidious -u 1000 -g invidious
# Copy config
COPY --chown=invidious config/config.example.yml config/config.yml
RUN sed -i 's/host: \(127.0.0.1\|localhost\)/host: invidious-db/' 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 invidious
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD [ "/invidious/invidious" ]