File tree Expand file tree Collapse file tree 5 files changed +67
-1
lines changed Expand file tree Collapse file tree 5 files changed +67
-1
lines changed Original file line number Diff line number Diff line change
1
+ version : ' 3'
2
+ services :
3
+ postgres :
4
+ build :
5
+ context : .
6
+ dockerfile : docker/Dockerfile.postgres
7
+ restart : unless-stopped
8
+ volumes :
9
+ - postgresdata:/var/lib/postgresql/data
10
+ invidious :
11
+ build :
12
+ context : .
13
+ dockerfile : docker/Dockerfile
14
+ restart : unless-stopped
15
+ ports :
16
+ - " 3000:3000"
17
+ depends_on :
18
+ - postgres
19
+
20
+ volumes :
21
+ postgresdata :
Original file line number Diff line number Diff line change
1
+ FROM archlinux/base
2
+
3
+ RUN pacman -Sy --noconfirm shards crystal imagemagick librsvg \
4
+ which pkgconf gcc ttf-liberation
5
+ # base-devel contains many other basic packages, that are normally assumed to already exist on a clean arch system
6
+
7
+ ADD . /invidious
8
+
9
+ WORKDIR /invidious
10
+
11
+ RUN sed -i 's/host: localhost/host: postgres/' config/config.yml && \
12
+ shards && \
13
+ crystal build src/invidious.cr
14
+
15
+ CMD [ "/invidious/invidious" ]
Original file line number Diff line number Diff line change
1
+ FROM postgres:10
2
+
3
+ ENV POSTGRES_USER postgres
4
+
5
+ ADD ./setup.sh /setup.sh
6
+ ADD ./config/sql /config/sql
7
+ ADD ./docker/entrypoint.postgres.sh /entrypoint.sh
8
+
9
+ ENTRYPOINT [ "/entrypoint.sh" ]
10
+ CMD [ "postgres" ]
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ CMD=" $@ "
4
+ if [ ! -f /var/lib/postgresql/data/setupFinished ]; then
5
+ echo " ### first run - setting up invidious database"
6
+ /usr/local/bin/docker-entrypoint.sh postgres &
7
+ sleep 10
8
+ until runuser -l postgres -c ' pg_isready' 2> /dev/null; do
9
+ >&2 echo " ### Postgres is unavailable - waiting"
10
+ sleep 5
11
+ done
12
+ >&2 echo " ### importing table schemas"
13
+ su postgres -c " /setup.sh" && touch /var/lib/postgresql/data/setupFinished
14
+ echo " ### invidious database setup finished"
15
+ exit
16
+ fi
17
+
18
+ echo " running postgres /usr/local/bin/docker-entrypoint.sh $CMD "
19
+ exec /usr/local/bin/docker-entrypoint.sh $CMD
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
3
createdb invidious
4
- createuser kemal
4
+ # createuser kemal
5
+ psql -c " CREATE USER kemal WITH PASSWORD 'kemal';"
5
6
psql invidious < config/sql/channels.sql
6
7
psql invidious < config/sql/videos.sql
7
8
psql invidious < config/sql/channel_videos.sql
You can’t perform that action at this time.
0 commit comments