-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.centos
52 lines (43 loc) · 1.7 KB
/
Dockerfile.centos
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
FROM docker.io/library/almalinux:8@sha256:d7dbaf57916185b2be09e1eaa1156b543f3937164ffa08d7fdc020a0a3800a5a AS builder
RUN dnf install dnf-plugins-core -y && \
dnf config-manager --set-enabled powertools && \
dnf install git-core xz-devel sqlite-libs libxml2-devel libyaml-devel sqlite-devel openssl-devel -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/almalinux:8@sha256:d7dbaf57916185b2be09e1eaa1156b543f3937164ffa08d7fdc020a0a3800a5a AS release
RUN dnf install epel-release -y && \
dnf install libxml2 librsvg2 librsvg2-tools libyaml sqlite openssl libevent tini -y && \
dnf clean all
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" ]