[gulp] Update docker for static version

This commit is contained in:
Joxit 2016-07-21 22:45:32 +02:00
parent 97b63eda33
commit d5f1ca7951
2 changed files with 14 additions and 37 deletions

View File

@ -12,43 +12,15 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
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

View File

@ -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