]>
Commit | Line | Data |
---|---|---|
1 | FROM ubuntu:bionic | |
2 | ||
3 | # Avoid tzdata interactive dialog | |
4 | ENV DEBIAN_FRONTEND=noninteractive | |
5 | ||
6 | # Install PeerTube's dependencies. | |
7 | # Packages are from https://github.com/Chocobozzz/PeerTube#dependencies | |
8 | RUN apt-get update -q && apt-get install -qy \ | |
9 | curl \ | |
10 | nano \ | |
11 | ffmpeg \ | |
12 | postgresql \ | |
13 | postgresql-contrib \ | |
14 | openssl \ | |
15 | g++ \ | |
16 | make \ | |
17 | redis-server \ | |
18 | git \ | |
19 | gnupg | |
20 | ||
21 | # Install NodeJS 8.x | |
22 | RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && \ | |
23 | apt-get install -y nodejs | |
24 | ||
25 | # Install Yarn | |
26 | RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ | |
27 | echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ | |
28 | apt-get update && apt-get install yarn | |
29 | ||
30 | # Download PeerTube's source code. | |
31 | RUN git clone -b develop https://github.com/Chocobozzz/PeerTube /home/user/PeerTube | |
32 | WORKDIR /home/user/PeerTube | |
33 | ||
34 | # Install dependencies. | |
35 | RUN yarn install --pure-lockfile | |
36 | ||
37 | # Configure and run PeerTube. | |
38 | COPY setup_postgres.sql /tmp/ | |
39 | RUN service postgresql start \ | |
40 | && su postgres -c "psql --file=/tmp/setup_postgres.sql" | |
41 | ||
42 | # Expose PeerTube sources as a volume | |
43 | VOLUME /home/user/PeerTube | |
44 | ||
45 | EXPOSE 3000 9000 | |
46 | ||
47 | # Start PostgreSQL and Redis | |
48 | CMD service postgresql start && redis-server |