Fixes #205: Fix Janitor configuration;
authorBenjamin Bouvier <public@benj.me>
Tue, 16 Jan 2018 22:37:15 +0000 (23:37 +0100)
committerChocobozzz <me@florianbigard.com>
Thu, 25 Jan 2018 10:13:07 +0000 (11:13 +0100)
scripts/watch/client.sh
support/docker/dev/Dockerfile
support/docker/dev/create_user.sql [new file with mode: 0644]
support/docker/dev/janitor.json
support/docker/dev/supervisord.conf [new file with mode: 0644]

index 09dcc23acab1a2c55b70278da557f65629ce089f..d8c3a254740f942483cc8522c7ff9206a306e637 100755 (executable)
@@ -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
index ccad92f6b2648b167dd08798a0191ef6d0ef34d3..8a99496a637916812bd6601bf309ca2b85e8707b 100644 (file)
@@ -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 (file)
index 0000000..c2fbcf2
--- /dev/null
@@ -0,0 +1,3 @@
+create database peertube_dev;
+create user peertube password 'peertube';
+grant all privileges on database peertube_dev to peertube;
index 6452f56c85c91b07d7dc01746d38632926c8ffd5..4051e8bcdb1a092ab2b35cc15c9bc22f411b472f 100644 (file)
       "label": "SSH",
       "proxy": "none"
     },
+    "3000": {
+      "label": "PeerTube web app",
+      "proxy": "https",
+      "preview": true
+    },
     "8088": {
       "label": "VNC",
       "proxy": "https"
       "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 (file)
index 0000000..b2e1682
--- /dev/null
@@ -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