Skip to content

Commit

Permalink
feat: add invidious
Browse files Browse the repository at this point in the history
  • Loading branch information
ajgon committed Dec 5, 2023
1 parent 4521ce2 commit 46b6475
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 0 deletions.
30 changes: 30 additions & 0 deletions apps/invidious/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
ARG TARGETPLATFORM
ARG VERSION
FROM quay.io/invidious/invidious:latest@sha256:2d4a1bc6a017b9833782778d3b2bfb3baba7d2b20dfad96ab5a4ba27c522dba5 AS source

FROM ghcr.io/deedee-ops/alpine:3.18.5

ARG TARGETPLATFORM
ARG VERSION
ARG CHANNEL

COPY --from=source --chown=65000:65000 /invidious /app/

#hadolint ignore=DL3018
RUN apk add --no-cache librsvg postgresql-client ttf-opensans yq \
&& curl -o /app/init-invidious-db.sh https://raw.githubusercontent.com/iv-org/invidious/master/docker/init-invidious-db.sh \
&& sed -i'' "s@--dbname@--host \"\$POSTGRES_HOST:\${POSTGRES_PORT:-5432}\" --dbname@g" /app/init-invidious-db.sh \
&& mkdir -p /config \
&& chown -R 65000:65000 /config \
&& mv /app/config/config.yml /config/config.yml \
&& ln -s /config/config.yml /app/config/config.yml

COPY --chmod=0755 --chown=65000:65000 entrypoint.sh /usr/local/bin/entrypoint.sh
USER 65000:65000

EXPOSE 3000
VOLUME ["/tmp"]
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/base-entrypoint.sh", "/usr/local/bin/entrypoint.sh"]
CMD ["/app/invidious"]

LABEL org.opencontainers.image.source="https://github.com/iv-org/invidious/"
20 changes: 20 additions & 0 deletions apps/invidious/ci/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
# https://github.com/goss-org/goss/blob/master/docs/manual.md#group
group:
abc:
exists: true
gid: 65000
# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#file
file:
/app/invidious:
exists: true
# https://github.com/goss-org/goss/blob/master/docs/manual.md#mount
mount:
/tmp:
exists: true
# https://github.com/goss-org/goss/blob/master/docs/manual.md#user
user:
abc:
exists: true
uid: 65000
gid: 65000
11 changes: 11 additions & 0 deletions apps/invidious/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env sh

export POSTGRES_HOST="${POSTGRES_HOST:-$(yq '.db.host // ""' < /config/config.yml)}"
export POSTGRES_PORT="${POSTGRES_PORT:-$(yq '.db.port //""' < /config/config.yml)}"
export POSTGRES_USER="${POSTGRES_USER:-$(yq '.db.user // ""' < /config/config.yml)}"
export POSTGRES_DB="${POSTGRES_DB:-$(yq '.db.dbname // ""' < /config/config.yml)}"
export PGPASSWORD="${POSTGRES_PASS:-$(yq '.db.password //""' < /config/config.yml)}"

sh /app/init-invidious-db.sh

exec "$@"
17 changes: 17 additions & 0 deletions apps/invidious/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"app": "invidious",
"base": false,
"testMuteCmd": true,
"channels": [
{
"name": "devel",
"renovate::dataSource": "docker",
"renovate::depName": "quay.io/invidious/invidious",
"version": "latest",
"platforms": [
"linux/amd64",
"linux/arm64"
]
}
]
}

0 comments on commit 46b6475

Please sign in to comment.