File tree Expand file tree Collapse file tree 4 files changed +34
-6
lines changed Expand file tree Collapse file tree 4 files changed +34
-6
lines changed Original file line number Diff line number Diff line change 1- FROM node:10
1+ FROM skydive/skydive
2+
23WORKDIR /usr/src/skydive-ui
4+
5+ RUN apt-get -y update \
6+ && apt-get -y install nodejs npm
7+
38COPY package.json /usr/src/skydive-ui
9+ COPY package-lock.json /usr/src/skydive-ui
10+ COPY tsconfig.json /usr/src/skydive-ui
11+ COPY webpack.config.js /usr/src/skydive-ui
12+ COPY assets /usr/src/skydive-ui/assets
13+ COPY src /usr/src/skydive-ui/src
14+ COPY entry.sh /usr/src/skydive-ui
15+
416RUN npm install
5- COPY . .
6- CMD [ "/usr/src/skydive-ui/node_modules/webpack-dev-server/bin/webpack-dev-server.js" , "--host" , "0.0.0.0" ]
17+ RUN npm run build
18+
19+ ENTRYPOINT /usr/src/skydive-ui/entry.sh
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ if [ -f /dump.json ]; then
4+ /usr/bin/skydive --conf /etc/skydive.yml analyzer &
5+ sleep 15
6+
7+ /usr/bin/skydive client topology import --file /dump.json
8+ fi
9+
10+ python3 -m http.server 8080 --directory dist/
Original file line number Diff line number Diff line change 11{
2- "name" : " topsky " ,
2+ "name" : " skydive-ui " ,
33 "version" : " 0.1.0" ,
44 "private" : true ,
55 "dependencies" : {
6969 "webpack-dev-server" : " ^3.11.0"
7070 },
7171 "scripts" : {
72- "start" : " webpack serve --mode development --disable-host-check --host 0.0.0.0 --open-page=$PAGE " ,
73- "build" : " webpack --mode production " ,
72+ "start" : " webpack serve --mode development --disable-host-check --host 0.0.0.0" ,
73+ "build" : " webpack" ,
7474 "test" : " TS_NODE_COMPILER_OPTIONS='{\" module\" :\" commonjs\" }' mocha -r ts-node/register tests/**/*.test.ts" ,
7575 "coverage" : " nyc -r lcov -e .ts -x \" *.test.ts\" npm run test"
7676 }
Original file line number Diff line number Diff line change 11const HtmlWebPackPlugin = require ( "html-webpack-plugin" ) ;
22const CopyWebPackPlugin = require ( 'copy-webpack-plugin' ) ;
33
4+ var path = require ( 'path' ) ;
5+
46const htmlPlugin = new HtmlWebPackPlugin ( {
57 template : "./src/index.html" ,
68 filename : "./index.html"
@@ -55,6 +57,9 @@ module.exports = {
5557
5658 devServer : {
5759 historyApiFallback : true ,
60+ contentBase : path . join ( __dirname , 'dist' ) ,
61+ compress : true ,
62+ port : 8080
5863 } ,
5964
6065 devtool : "source-map" ,
You can’t perform that action at this time.
0 commit comments