diff options
author | Chocobozzz <me@florianbigard.com> | 2018-04-16 18:44:57 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-04-16 18:44:57 +0200 |
commit | 4aeb67a569b30a233dcff2eaf9c564d62ccd6497 (patch) | |
tree | 9851e0c0206e6d87ac23b50ec11d0f092ffd9594 /support/docker/production/Dockerfile.stretch | |
parent | 94ff4c2335ace54b36b2bca96f63226ee8f575b1 (diff) | |
download | PeerTube-4aeb67a569b30a233dcff2eaf9c564d62ccd6497.tar.gz PeerTube-4aeb67a569b30a233dcff2eaf9c564d62ccd6497.tar.zst PeerTube-4aeb67a569b30a233dcff2eaf9c564d62ccd6497.zip |
Improve dockerfile
Diffstat (limited to 'support/docker/production/Dockerfile.stretch')
-rw-r--r-- | support/docker/production/Dockerfile.stretch | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/support/docker/production/Dockerfile.stretch b/support/docker/production/Dockerfile.stretch index bf2bae510..5bb67f816 100644 --- a/support/docker/production/Dockerfile.stretch +++ b/support/docker/production/Dockerfile.stretch | |||
@@ -33,7 +33,13 @@ RUN set -ex; \ | |||
33 | wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ | 33 | wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ |
34 | wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ | 34 | wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ |
35 | export GNUPGHOME="$(mktemp -d)"; \ | 35 | export GNUPGHOME="$(mktemp -d)"; \ |
36 | gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \ | 36 | for server in $(shuf -e ha.pool.sks-keyservers.net \ |
37 | hkp://p80.pool.sks-keyservers.net:80 \ | ||
38 | keyserver.ubuntu.com \ | ||
39 | hkp://keyserver.ubuntu.com:80 \ | ||
40 | pgp.mit.edu) ; do \ | ||
41 | gpg --keyserver "$server" --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 && break || : ; \ | ||
42 | done; \ | ||
37 | gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \ | 43 | gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \ |
38 | rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc; \ | 44 | rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc; \ |
39 | chmod +x /usr/local/bin/gosu; \ | 45 | chmod +x /usr/local/bin/gosu; \ |
@@ -41,13 +47,13 @@ RUN set -ex; \ | |||
41 | \ | 47 | \ |
42 | apt-get purge -y --auto-remove wget | 48 | apt-get purge -y --auto-remove wget |
43 | 49 | ||
44 | # Download the latest version | ||
45 | RUN git clone https://github.com/Chocobozzz/PeerTube /app \ | ||
46 | && chown -R peertube:peertube /app | ||
47 | |||
48 | # Install PeerTube | 50 | # Install PeerTube |
49 | USER peertube | ||
50 | WORKDIR /app | 51 | WORKDIR /app |
52 | RUN chown peertube:peertube /app | ||
53 | |||
54 | COPY --chown=peertube:peertube . ./ | ||
55 | |||
56 | USER peertube | ||
51 | 57 | ||
52 | RUN yarn install --pure-lockfile \ | 58 | RUN yarn install --pure-lockfile \ |
53 | && npm run build | 59 | && npm run build |
@@ -58,11 +64,11 @@ ENV NODE_ENV production | |||
58 | ENV NODE_CONFIG_DIR /app/support/docker/production/config | 64 | ENV NODE_CONFIG_DIR /app/support/docker/production/config |
59 | 65 | ||
60 | USER root | 66 | USER root |
61 | RUN mkdir /data && chown peertube:peertube /data | 67 | RUN mkdir /data |
62 | VOLUME /data | 68 | VOLUME /data |
63 | 69 | ||
64 | COPY docker-entrypoint.sh /usr/local/bin/ | 70 | COPY ./support/docker/production/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh |
65 | ENTRYPOINT ["docker-entrypoint.sh"] | 71 | ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] |
66 | 72 | ||
67 | # Run the application | 73 | # Run the application |
68 | CMD ["npm", "start"] | 74 | CMD ["npm", "start"] |