From: Benjamin Bouvier Date: Tue, 16 Jan 2018 22:37:15 +0000 (+0100) Subject: Fixes #205: Fix Janitor configuration; X-Git-Tag: v0.0.16-alpha~25 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a585af352c8f78f62a964f81192516ee6a2556e1;p=oweals%2Fpeertube.git Fixes #205: Fix Janitor configuration; --- diff --git a/scripts/watch/client.sh b/scripts/watch/client.sh index 09dcc23ac..d8c3a2547 100755 --- a/scripts/watch/client.sh +++ b/scripts/watch/client.sh @@ -2,4 +2,4 @@ cd client || exit -1 -npm run ng -- server --hmr --host localhost --port 3000 +npm run ng -- server --hmr --host 0.0.0.0 --port 3000 diff --git a/support/docker/dev/Dockerfile b/support/docker/dev/Dockerfile index ccad92f6b..8a99496a6 100644 --- a/support/docker/dev/Dockerfile +++ b/support/docker/dev/Dockerfile @@ -15,10 +15,19 @@ WORKDIR /home/user/PeerTube # Configure Cloud9 IDE to use PeerTube's source directory as workspace (-w). RUN sudo sed -i "s/-w \/home\/user/-w \/home\/user\/PeerTube/" /etc/supervisord.conf +# Install dependencies. +RUN yarn install --pure-lockfile + # Configure Janitor for PeerTube. ADD janitor.json /home/user/ RUN sudo chown user:user /home/user/janitor.json # Configure and build PeerTube. -RUN yarn install \ - && npm run build +ADD create_user.sql /tmp/ +RUN sudo service postgresql start && \ + sudo -u postgres psql --file=/tmp/create_user.sql + +ADD supervisord.conf /tmp/supervisord-extra.conf +RUN cat /tmp/supervisord-extra.conf | sudo tee -a /etc/supervisord.conf + +EXPOSE 3000 9000 diff --git a/support/docker/dev/create_user.sql b/support/docker/dev/create_user.sql new file mode 100644 index 000000000..c2fbcf27e --- /dev/null +++ b/support/docker/dev/create_user.sql @@ -0,0 +1,3 @@ +create database peertube_dev; +create user peertube password 'peertube'; +grant all privileges on database peertube_dev to peertube; diff --git a/support/docker/dev/janitor.json b/support/docker/dev/janitor.json index 6452f56c8..4051e8bcd 100644 --- a/support/docker/dev/janitor.json +++ b/support/docker/dev/janitor.json @@ -10,6 +10,11 @@ "label": "SSH", "proxy": "none" }, + "3000": { + "label": "PeerTube web app", + "proxy": "https", + "preview": true + }, "8088": { "label": "VNC", "proxy": "https" @@ -19,13 +24,12 @@ "proxy": "https" }, "9000": { - "label": "PeerTube", - "proxy": "https", - "preview": true + "label": "PeerTube API", + "proxy": "https" } }, "scripts": { - "Start PeerTube": "npm start", + "Start PeerTube": "npm run dev", "Build PeerTube": "npm run build", "Run tests": "npm test", "Update source code": "git pull --rebase origin", diff --git a/support/docker/dev/supervisord.conf b/support/docker/dev/supervisord.conf new file mode 100644 index 000000000..b2e1682df --- /dev/null +++ b/support/docker/dev/supervisord.conf @@ -0,0 +1,3 @@ +[program:postgresql] +user = user +command = sudo -u postgres /usr/lib/postgresql/9.5/bin/postgres -D /var/lib/postgresql/9.5/main -c config_file=/etc/postgresql/9.5/main/postgresql.conf