diff options
Diffstat (limited to 'support/docker/dev/Dockerfile')
-rw-r--r-- | support/docker/dev/Dockerfile | 54 |
1 files changed, 34 insertions, 20 deletions
diff --git a/support/docker/dev/Dockerfile b/support/docker/dev/Dockerfile index 2b4f2b215..8e049f3f6 100644 --- a/support/docker/dev/Dockerfile +++ b/support/docker/dev/Dockerfile | |||
@@ -1,32 +1,46 @@ | |||
1 | FROM janitortechnology/ubuntu-dev | 1 | FROM ubuntu:bionic |
2 | |||
3 | # Avoid tzdata interactive dialog | ||
4 | ENV DEBIAN_FRONTEND=noninteractive | ||
2 | 5 | ||
3 | # Install PeerTube's dependencies. | 6 | # Install PeerTube's dependencies. |
4 | # Packages are from https://github.com/Chocobozzz/PeerTube#dependencies | 7 | # Packages are from https://github.com/Chocobozzz/PeerTube#dependencies |
5 | RUN sudo apt-get update -q && sudo apt-get install -qy \ | 8 | RUN apt-get update -q && apt-get install -qy \ |
6 | ffmpeg \ | 9 | curl \ |
7 | postgresql \ | 10 | ffmpeg \ |
8 | openssl | 11 | g++ \ |
12 | git \ | ||
13 | gnupg \ | ||
14 | make \ | ||
15 | nano \ | ||
16 | openssl \ | ||
17 | postgresql \ | ||
18 | postgresql-contrib \ | ||
19 | redis-server \ | ||
20 | && curl -sL https://deb.nodesource.com/setup_8.x | bash - \ | ||
21 | && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ | ||
22 | && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ | ||
23 | && apt-get update \ | ||
24 | && apt-get install -qy nodejs yarn \ | ||
25 | && rm -rf /var/lib/apt/lists/* | ||
9 | 26 | ||
10 | # Download PeerTube's source code. | 27 | # Download PeerTube's source code. |
11 | RUN git clone -b develop https://github.com/Chocobozzz/PeerTube /home/user/PeerTube | 28 | RUN git clone -b develop https://github.com/Chocobozzz/PeerTube /home/user/PeerTube |
12 | WORKDIR /home/user/PeerTube | 29 | WORKDIR /home/user/PeerTube |
13 | 30 | ||
14 | # Configure the IDEs to use Janitor's source directory as workspace. | 31 | # Copy postgresql setup script |
15 | ENV WORKSPACE /home/user/PeerTube/ | 32 | COPY setup_postgres.sql /tmp/ |
16 | |||
17 | # Install dependencies. | ||
18 | RUN yarn install --pure-lockfile | ||
19 | 33 | ||
20 | # Configure Janitor for PeerTube. | 34 | # Install Node.js dependencies and setup PostgreSQL |
21 | COPY --chown=user:user janitor.json /home/user/ | 35 | RUN yarn install --pure-lockfile \ |
36 | && service postgresql start \ | ||
37 | && su postgres -c "psql --file=/tmp/setup_postgres.sql" | ||
22 | 38 | ||
23 | # Configure and build PeerTube. | 39 | # Expose PeerTube sources as a volume |
24 | COPY create_user.sql /tmp/ | 40 | VOLUME /home/user/PeerTube |
25 | RUN sudo service postgresql start \ | ||
26 | && sudo -u postgres psql --file=/tmp/create_user.sql \ | ||
27 | && npm run build | ||
28 | |||
29 | COPY --chown=user:user supervisord.conf /tmp/supervisord-extra.conf | ||
30 | RUN cat /tmp/supervisord-extra.conf | sudo tee -a /etc/supervisord.conf | ||
31 | 41 | ||
42 | # Expose API and frontend | ||
32 | EXPOSE 3000 9000 | 43 | EXPOSE 3000 9000 |
44 | |||
45 | # Start PostgreSQL and Redis | ||
46 | CMD ["service postgresql start && redis-server"] | ||