aboutsummaryrefslogtreecommitdiffhomepage
path: root/support
diff options
context:
space:
mode:
authorKyâne Pichou <kyane@kyane.fr>2018-10-22 14:37:40 +0200
committerChocobozzz <me@florianbigard.com>2018-10-22 14:37:40 +0200
commit4293e362af90fd61f22d5b88d926165e970e53db (patch)
tree151d7a0a7c6c043cab41a7e704065459c0068899 /support
parent7cf3e57376422e890e9703b68107e6f568a11384 (diff)
downloadPeerTube-4293e362af90fd61f22d5b88d926165e970e53db.tar.gz
PeerTube-4293e362af90fd61f22d5b88d926165e970e53db.tar.zst
PeerTube-4293e362af90fd61f22d5b88d926165e970e53db.zip
Improve dev Dockerfile (#1333)
* Improve dev Dockerfile Use Docker best-practices for the development Dockerfile. Save 3Mo. * Update support/docker/dev/Dockerfile Co-Authored-By: pichouk <kyane@kyane.fr>
Diffstat (limited to 'support')
-rw-r--r--support/docker/dev/Dockerfile52
1 files changed, 25 insertions, 27 deletions
diff --git a/support/docker/dev/Dockerfile b/support/docker/dev/Dockerfile
index aa4a8a3d6..8e049f3f6 100644
--- a/support/docker/dev/Dockerfile
+++ b/support/docker/dev/Dockerfile
@@ -6,43 +6,41 @@ ENV DEBIAN_FRONTEND=noninteractive
6# Install PeerTube's dependencies. 6# Install PeerTube's dependencies.
7# Packages are from https://github.com/Chocobozzz/PeerTube#dependencies 7# Packages are from https://github.com/Chocobozzz/PeerTube#dependencies
8RUN apt-get update -q && apt-get install -qy \ 8RUN apt-get update -q && apt-get install -qy \
9 curl \ 9 curl \
10 nano \ 10 ffmpeg \
11 ffmpeg \ 11 g++ \
12 postgresql \ 12 git \
13 postgresql-contrib \ 13 gnupg \
14 openssl \ 14 make \
15 g++ \ 15 nano \
16 make \ 16 openssl \
17 redis-server \ 17 postgresql \
18 git \ 18 postgresql-contrib \
19 gnupg 19 redis-server \
20 20 && curl -sL https://deb.nodesource.com/setup_8.x | bash - \
21# Install NodeJS 8.x 21 && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
22RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && \ 22 && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
23 apt-get install -y nodejs 23 && apt-get update \
24 24 && apt-get install -qy nodejs yarn \
25# Install Yarn 25 && rm -rf /var/lib/apt/lists/*
26RUN 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 26
30# Download PeerTube's source code. 27# Download PeerTube's source code.
31RUN git clone -b develop https://github.com/Chocobozzz/PeerTube /home/user/PeerTube 28RUN git clone -b develop https://github.com/Chocobozzz/PeerTube /home/user/PeerTube
32WORKDIR /home/user/PeerTube 29WORKDIR /home/user/PeerTube
33 30
34# Install dependencies. 31# Copy postgresql setup script
35RUN yarn install --pure-lockfile
36
37# Configure and run PeerTube.
38COPY setup_postgres.sql /tmp/ 32COPY setup_postgres.sql /tmp/
39RUN service postgresql start \ 33
40 && su postgres -c "psql --file=/tmp/setup_postgres.sql" 34# Install Node.js dependencies and setup PostgreSQL
35RUN yarn install --pure-lockfile \
36 && service postgresql start \
37 && su postgres -c "psql --file=/tmp/setup_postgres.sql"
41 38
42# Expose PeerTube sources as a volume 39# Expose PeerTube sources as a volume
43VOLUME /home/user/PeerTube 40VOLUME /home/user/PeerTube
44 41
42# Expose API and frontend
45EXPOSE 3000 9000 43EXPOSE 3000 9000
46 44
47# Start PostgreSQL and Redis 45# Start PostgreSQL and Redis
48CMD service postgresql start && redis-server 46CMD ["service postgresql start && redis-server"]