diff --git a/Dockerfile.static b/Dockerfile.static index 9713ca3..1f6d87c 100644 --- a/Dockerfile.static +++ b/Dockerfile.static @@ -12,43 +12,15 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -FROM node:slim +FROM nginx MAINTAINER Jones MAGLOIRE @Joxit -WORKDIR /usr/src/app +WORKDIR /usr/share/nginx/html/ -RUN npm install -g http-server && npm cache clean +COPY dist/ /usr/share/nginx/html/ +COPY dist/scripts/script-static.js /usr/share/nginx/html/scripts/script.js +COPY dist/scripts/tags-static.js /usr/share/nginx/html/scripts/tags.js +COPY bin/entrypoint /bin -COPY package.json /usr/src/app - -RUN npm install \ - && find node_modules/ \ - -maxdepth 1 -mindepth 1 -type d \ - ! -name riot \ - ! -name material-design-icons \ - ! -name material-design-* \ - ! -name dialog-polyfill \ - ! -name riotgear-router \ - -exec rm -rf {} \; \ - && find node_modules/material-design-* \ - -maxdepth 1 -mindepth 1 \ - ! -name package.json \ - ! -name iconfont \ - ! -name LICENSE \ - ! -name material* \ - ! -name dist \ - -exec rm -rf {} \; \ - && find node_modules/material-design-lite/dist/ -maxdepth 1 -mindepth 1 \ - ! -name "*.js*" \ - ! -name "*.css*" \ - -exec rm -rf {} \; \ - && npm cache clean - -COPY . /usr/src/app -COPY static/*.* /usr/src/app/ -COPY static/entrypoint /bin - -EXPOSE 8080 - -ENTRYPOINT entrypoint +ENTRYPOINT entrypoint \ No newline at end of file diff --git a/bin/entrypoint b/bin/entrypoint index 6f09aad..17f7fe6 100755 --- a/bin/entrypoint +++ b/bin/entrypoint @@ -1,4 +1,9 @@ #!/bin/bash -sed -i "s,\${URL},${URL}," script.js +$@ +sed -i "s,\${URL},${URL}," scripts/script.js -http-server $@ +if [ -z "$@" ]; then + nginx -g "daemon off;" +else + $@ +fi \ No newline at end of file