2018-10-09 11:35:02 -04:00
|
|
|
FROM ubuntu:bionic
|
|
|
|
|
|
|
|
# Avoid tzdata interactive dialog
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
2017-12-04 04:58:02 -05:00
|
|
|
|
|
|
|
# Install PeerTube's dependencies.
|
|
|
|
# Packages are from https://github.com/Chocobozzz/PeerTube#dependencies
|
2018-10-09 11:35:02 -04:00
|
|
|
RUN apt-get update -q && apt-get install -qy \
|
2018-10-22 08:37:40 -04:00
|
|
|
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/*
|
2017-12-04 04:58:02 -05: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 08:37:40 -04:00
|
|
|
# Copy postgresql setup script
|
2018-10-09 11:35:02 -04:00
|
|
|
COPY setup_postgres.sql /tmp/
|
2018-10-22 08:37:40 -04: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 10:46:04 -05:00
|
|
|
|
2018-10-09 11:35:02 -04:00
|
|
|
# Expose PeerTube sources as a volume
|
|
|
|
VOLUME /home/user/PeerTube
|
2018-01-16 17:37:15 -05:00
|
|
|
|
2018-10-22 08:37:40 -04:00
|
|
|
# Expose API and frontend
|
2018-01-16 17:37:15 -05:00
|
|
|
EXPOSE 3000 9000
|
2018-10-09 11:35:02 -04:00
|
|
|
|
|
|
|
# Start PostgreSQL and Redis
|
2018-10-22 08:37:40 -04:00
|
|
|
CMD ["service postgresql start && redis-server"]
|