diff --git a/Dockerfile b/Dockerfile index 0ef3cbe9..73102515 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,6 +42,7 @@ RUN npm install COPY ./docker/docker-entrypoint.sh / RUN chmod +x /docker-entrypoint.sh + ENTRYPOINT ["/docker-entrypoint.sh"] CMD ["nginx", "-g", "pid /tmp/nginx.pid;daemon off;"] EXPOSE 8000 diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 59e79a36..e41ce28a 100755 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -1,16 +1,16 @@ #!/bin/ash set -e -echo $DOCKER_UID -echo $DOCKER_USER -addgroup $DOCKER_USER -adduser $DOCKER_USER -G $DOCKER_USER -u $DOCKER_UID -D +for plugin in `find ./plugins -mindepth 1 -maxdepth 1 -type d`; do + cd $WORKDIR/$plugin + npm install + cd - +done -chown -R $DOCKER_USER $WORKDIR -chown -R $DOCKER_USER /usr/share/nginx/html -chown -R $DOCKER_USER /var/lib/nginx -chown -R $DOCKER_USER /var/log/nginx +npm run build && cp -r $WORKDIR/dist/* /usr/share/nginx/html/ -su $DOCKER_USER +chown -R $DOCKER_UID /usr/share/nginx/html/* + +sed -i "s|http://localhost:9000|$REST_URL|g" /usr/share/nginx/html/assets/index.*.js exec "$@"