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