Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Dockerfile #849

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
language: node_js
node_js:
- "6"
- "14.4.0"
env:
- NODE_OPTIONS=--max-old-space-size=8192
before_script:
- export TZ=America/Los_Angeles
script:
Expand Down
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM node:14.4.0

COPY . /voyager

RUN cd voyager && yarn && yarn build

WORKDIR /voyager

EXPOSE 9000

CMD ["yarn", "start:headless"]
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,21 @@ This will run Voyager in "server-mode" sending requests to voyager-server, which
The server url is controlled by the `SERVER` environment variable.

See [voyager-server](https://github.com/vega/voyager-server) for more information on what portions of the functionality the server handles.

## Docker
Docker image based on [node:14.4.0](https://hub.docker.com/layers/node/library/node/14.4.0/images/sha256-13c35ec2a3829f25171a8da49ea83366f7bf901cf0570002cd82769df49872be?context=explore)

Build Docker image
```
docker build -t vega/voyager .
```

Run Docker container. The `-p 9000:9000` parameter is required to publish the container's yarn port to a host port, allowing users to view the datavoyager tool at http://localhost:9000/.
```
docker run -p 9000:9000 vega/voyager
```

Alternatively, run the Docker container detatched with `-d` to not receive log information in the console.
```
docker run -d -p 9000:9000 vega/voyager
```
1 change: 1 addition & 0 deletions config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ module.exports = {
contentBase: path.resolve(__dirname, '../'),
compress: true,
hot: true,
host: '0.0.0.0',
port: 9000
},

Expand Down
1 change: 1 addition & 0 deletions config/webpack.config.lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module.exports = {
devServer: {
contentBase: path.resolve(__dirname, '../'),
compress: true,
host: '0.0.0.0',
port: 9000
},

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"// for postinstall need to rebuild sass. Otherwise, yarn would forgot to include vendor for node-sass": "",
"postinstall": "npm rebuild node-sass",
"start": "webpack-dev-server --open --config config/webpack.config.dev.js",
"start:headless": "webpack-dev-server --config config/webpack.config.dev.js",
"start:server": "cross-env SERVER=\"http://localhost:3000\" webpack-dev-server --open --config config/webpack.config.dev.js",
"build": "node scripts/build.js",
"postbuild": "npm run tsc && npm run build:lib",
Expand Down Expand Up @@ -118,7 +119,7 @@
"gh-pages": "^1.0.0",
"html-webpack-plugin": "^2.28.0",
"jest": "20",
"node-sass": "^4.5.3",
"node-sass": "^4.12.0",
"postcss-loader": "^1.3.3",
"react-addons-test-utils": "15.4.2",
"react-dev-utils": "^0.5.2",
Expand Down
Loading