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/dev/Dockerfile | 48 ++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 16 deletions(-) (limited to 'support/docker/dev/Dockerfile') diff --git a/support/docker/dev/Dockerfile b/support/docker/dev/Dockerfile index 2b4f2b215..aa4a8a3d6 100644 --- a/support/docker/dev/Dockerfile +++ b/support/docker/dev/Dockerfile @@ -1,32 +1,48 @@ -FROM janitortechnology/ubuntu-dev +FROM ubuntu:bionic + +# Avoid tzdata interactive dialog +ENV DEBIAN_FRONTEND=noninteractive # Install PeerTube's dependencies. # Packages are from https://github.com/Chocobozzz/PeerTube#dependencies -RUN sudo apt-get update -q && sudo apt-get install -qy \ +RUN apt-get update -q && apt-get install -qy \ + curl \ + nano \ ffmpeg \ postgresql \ - openssl + postgresql-contrib \ + openssl \ + g++ \ + make \ + redis-server \ + git \ + gnupg + +# Install NodeJS 8.x +RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && \ + apt-get install -y nodejs + +# Install Yarn +RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ + apt-get update && apt-get install yarn # 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 run PeerTube. +COPY setup_postgres.sql /tmp/ +RUN service postgresql start \ + && su postgres -c "psql --file=/tmp/setup_postgres.sql" -# 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 PeerTube sources as a volume +VOLUME /home/user/PeerTube EXPOSE 3000 9000 + +# Start PostgreSQL and Redis +CMD service postgresql start && redis-server -- cgit v1.2.3 From 4293e362af90fd61f22d5b88d926165e970e53db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=A2ne=20Pichou?= Date: Mon, 22 Oct 2018 14:37:40 +0200 Subject: Improve dev Dockerfile (#1333) * Improve dev Dockerfile Use Docker best-practices for the development Dockerfile. Save 3Mo. * Update support/docker/dev/Dockerfile Co-Authored-By: pichouk --- support/docker/dev/Dockerfile | 52 +++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 27 deletions(-) (limited to 'support/docker/dev/Dockerfile') diff --git a/support/docker/dev/Dockerfile b/support/docker/dev/Dockerfile index aa4a8a3d6..8e049f3f6 100644 --- a/support/docker/dev/Dockerfile +++ b/support/docker/dev/Dockerfile @@ -6,43 +6,41 @@ ENV DEBIAN_FRONTEND=noninteractive # Install PeerTube's dependencies. # Packages are from https://github.com/Chocobozzz/PeerTube#dependencies RUN apt-get update -q && apt-get install -qy \ - curl \ - nano \ - ffmpeg \ - postgresql \ - postgresql-contrib \ - openssl \ - g++ \ - make \ - redis-server \ - git \ - gnupg - -# Install NodeJS 8.x -RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && \ - apt-get install -y nodejs - -# Install Yarn -RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ - echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ - apt-get update && apt-get install yarn + curl \ + ffmpeg \ + g++ \ + git \ + gnupg \ + make \ + nano \ + openssl \ + postgresql \ + postgresql-contrib \ + redis-server \ + && curl -sL https://deb.nodesource.com/setup_8.x | bash - \ + && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ + && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ + && apt-get update \ + && apt-get install -qy nodejs yarn \ + && rm -rf /var/lib/apt/lists/* # Download PeerTube's source code. RUN git clone -b develop https://github.com/Chocobozzz/PeerTube /home/user/PeerTube WORKDIR /home/user/PeerTube -# Install dependencies. -RUN yarn install --pure-lockfile - -# Configure and run PeerTube. +# Copy postgresql setup script COPY setup_postgres.sql /tmp/ -RUN service postgresql start \ - && su postgres -c "psql --file=/tmp/setup_postgres.sql" + +# Install Node.js dependencies and setup PostgreSQL +RUN yarn install --pure-lockfile \ + && service postgresql start \ + && su postgres -c "psql --file=/tmp/setup_postgres.sql" # Expose PeerTube sources as a volume VOLUME /home/user/PeerTube +# Expose API and frontend EXPOSE 3000 9000 # Start PostgreSQL and Redis -CMD service postgresql start && redis-server +CMD ["service postgresql start && redis-server"] -- cgit v1.2.3