From ee7c25c767c357bd12570889f8ccd79ba9ea4eb9 Mon Sep 17 00:00:00 2001 From: am97 Date: Tue, 9 Oct 2018 17:35:02 +0200 Subject: Create new Docker dev image (#1173) * Move the old dev docker files to support/docker/janitor * Create new Docker dev image --- support/docker/janitor/Dockerfile | 32 +++++++++++++++++++++++++ support/docker/janitor/create_user.sql | 3 +++ support/docker/janitor/janitor.json | 42 +++++++++++++++++++++++++++++++++ support/docker/janitor/supervisord.conf | 3 +++ 4 files changed, 80 insertions(+) create mode 100644 support/docker/janitor/Dockerfile create mode 100644 support/docker/janitor/create_user.sql create mode 100644 support/docker/janitor/janitor.json create mode 100644 support/docker/janitor/supervisord.conf (limited to 'support/docker/janitor') diff --git a/support/docker/janitor/Dockerfile b/support/docker/janitor/Dockerfile new file mode 100644 index 000000000..2b4f2b215 --- /dev/null +++ b/support/docker/janitor/Dockerfile @@ -0,0 +1,32 @@ +FROM janitortechnology/ubuntu-dev + +# Install PeerTube's dependencies. +# Packages are from https://github.com/Chocobozzz/PeerTube#dependencies +RUN sudo apt-get update -q && sudo apt-get install -qy \ + ffmpeg \ + postgresql \ + openssl + +# Download PeerTube's source code. +RUN git clone -b develop https://github.com/Chocobozzz/PeerTube /home/user/PeerTube +WORKDIR /home/user/PeerTube + +# Configure the IDEs to use Janitor's source directory as workspace. +ENV WORKSPACE /home/user/PeerTube/ + +# Install dependencies. +RUN yarn install --pure-lockfile + +# Configure Janitor for PeerTube. +COPY --chown=user:user janitor.json /home/user/ + +# Configure and build PeerTube. +COPY create_user.sql /tmp/ +RUN sudo service postgresql start \ + && sudo -u postgres psql --file=/tmp/create_user.sql \ + && npm run build + +COPY --chown=user:user 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/janitor/create_user.sql b/support/docker/janitor/create_user.sql new file mode 100644 index 000000000..c2fbcf27e --- /dev/null +++ b/support/docker/janitor/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/janitor/janitor.json b/support/docker/janitor/janitor.json new file mode 100644 index 000000000..5acdf3060 --- /dev/null +++ b/support/docker/janitor/janitor.json @@ -0,0 +1,42 @@ +{ + "name": "PeerTube", + "description": "Federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.", + "icon": "https://janitor.technology/img/peertube.svg", + "docker": { + "image": "chocobozzz/peertube-dev" + }, + "ports": { + "22": { + "label": "SSH", + "proxy": "none" + }, + "3000": { + "label": "PeerTube web app", + "proxy": "https", + "preview": true + }, + "8088": { + "label": "VNC", + "proxy": "https" + }, + "8089": { + "label": "Cloud9", + "proxy": "https" + }, + "8090": { + "label": "Theia", + "proxy": "https" + }, + "9000": { + "label": "PeerTube API", + "proxy": "https" + } + }, + "scripts": { + "Start PeerTube": "npm run dev", + "Build PeerTube": "npm run build", + "Run tests": "npm test", + "Update source code": "git pull --rebase origin", + "Send to code review": "hub pull-request" + } +} diff --git a/support/docker/janitor/supervisord.conf b/support/docker/janitor/supervisord.conf new file mode 100644 index 000000000..b2e1682df --- /dev/null +++ b/support/docker/janitor/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 -- cgit v1.2.3