]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - support/docker/production/Dockerfile.stretch
Fix dockerfile
[github/Chocobozzz/PeerTube.git] / support / docker / production / Dockerfile.stretch
index 5bb67f81619700b4ef5ae32178b51170a1d0fc3e..911d064f6c26c04ae6d07a1439fadf9270ad255b 100644 (file)
@@ -41,7 +41,7 @@ RUN set -ex; \
         gpg --keyserver "$server" --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 && break || : ; \
     done; \
     gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
-    rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc; \
+    rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc; \
     chmod +x /usr/local/bin/gosu; \
     gosu nobody true; \
     \
@@ -49,23 +49,27 @@ RUN set -ex; \
 
 # Install PeerTube
 WORKDIR /app
-RUN chown peertube:peertube /app
-
-COPY --chown=peertube:peertube . ./
+COPY . ./
+RUN chown -R peertube:peertube /app
 
 USER peertube
 
 RUN yarn install --pure-lockfile \
-    && npm run build
+    && npm run build \
+    && rm -r ./node_modules ./client/node_modules \
+    && yarn install --pure-lockfile --production \
+    && yarn cache clean
+
+USER root
+
+RUN mkdir /data /config
+RUN chown -R peertube:peertube /data /config
 
-# Configure PeerTube
-RUN cp /app/config/default.yaml /app/support/docker/production/config/default.yaml
 ENV NODE_ENV production
-ENV NODE_CONFIG_DIR /app/support/docker/production/config
+ENV NODE_CONFIG_DIR /config
 
-USER root
-RUN mkdir /data
 VOLUME /data
+VOLUME /config
 
 COPY ./support/docker/production/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
 ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]