2018-10-09 17:35:02 +02:00
|
|
|
FROM ubuntu:bionic
|
|
|
|
|
|
|
|
# Avoid tzdata interactive dialog
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
2017-12-04 10:58:02 +01:00
|
|
|
|
|
|
|
# Install PeerTube's dependencies.
|
|
|
|
# Packages are from https://github.com/Chocobozzz/PeerTube#dependencies
|
2018-10-09 17:35:02 +02:00
|
|
|
RUN apt-get update -q && apt-get install -qy \
|
2018-10-22 14:37:40 +02:00
|
|
|
curl \
|
|
|
|
ffmpeg \
|
|
|
|
g++ \
|
|
|
|
git \
|
|
|
|
gnupg \
|
|
|
|
make \
|
|
|
|
nano \
|
|
|
|
openssl \
|
|
|
|
postgresql \
|
|
|
|
postgresql-contrib \
|
|
|
|
redis-server \
|
2019-08-07 12:04:06 +02:00
|
|
|
&& curl -sL https://deb.nodesource.com/setup_10.x | bash - \
|
2018-10-22 14:37:40 +02:00
|
|
|
&& 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/*
|
2017-12-04 10:58:02 +01:00
|
|
|
|
|
|
|
# Download PeerTube's source code.
|
|
|
|
RUN git clone -b develop https://github.com/Chocobozzz/PeerTube /home/user/PeerTube
|
|
|
|
WORKDIR /home/user/PeerTube
|
|
|
|
|
2018-10-22 14:37:40 +02:00
|
|
|
# Copy postgresql setup script
|
2018-10-09 17:35:02 +02:00
|
|
|
COPY setup_postgres.sql /tmp/
|
2018-10-22 14:37:40 +02:00
|
|
|
|
|
|
|
# Install Node.js dependencies and setup PostgreSQL
|
|
|
|
RUN yarn install --pure-lockfile \
|
|
|
|
&& service postgresql start \
|
|
|
|
&& su postgres -c "psql --file=/tmp/setup_postgres.sql"
|
2018-01-16 16:46:04 +01:00
|
|
|
|
2018-10-09 17:35:02 +02:00
|
|
|
# Expose PeerTube sources as a volume
|
|
|
|
VOLUME /home/user/PeerTube
|
2018-01-16 23:37:15 +01:00
|
|
|
|
2018-10-22 14:37:40 +02:00
|
|
|
# Expose API and frontend
|
2018-01-16 23:37:15 +01:00
|
|
|
EXPOSE 3000 9000
|
2018-10-09 17:35:02 +02:00
|
|
|
|
|
|
|
# Start PostgreSQL and Redis
|
2018-10-22 14:37:40 +02:00
|
|
|
CMD ["service postgresql start && redis-server"]
|