Add multistage docker image (11MB) (#164)

This commit is contained in:
Chevdor 2018-07-31 15:29:00 +02:00 committed by Jaco Greeff
parent ea523021ce
commit ede7b13c77
3 changed files with 31 additions and 4 deletions

12
Dockerfile Normal file
View File

@ -0,0 +1,12 @@
FROM node:10 as builder
MAINTAINER "chevdor@gmail.com"
WORKDIR /polkadot
COPY . .
RUN yarn && \
yarn build
FROM nginx:alpine
# RUN apk --no-cache add ca-certificates
# WORKDIR /app
COPY --from=builder /polkadot/packages/apps/build /usr/share/nginx/html
# CMD ["./app"]

View File

@ -64,3 +64,13 @@ Demos for the different libraries can be viewed with `yarn run demo:<name>` and
## tutorials
Looking for tutorials to get started? Look at [examples](examples/README.md) for a step-by-step guide to using the API and Components to display some information.
## Docker
### Run
docker run --rm -it --name polkadot-ui -p 80:80 chevdor/polkadot-ui:latest
### Build
docker build -t chevdor/polkadot-ui:latest .

View File

@ -36,9 +36,14 @@ function App ({ className, style }: Props) {
);
}
createApp(App, {
// tslint:disable-next-line
url: (process.env.WS_URL === null) || (process.env.WS_URL === '')
// tslint:disable-next-line
var url = (process.env.WS_URL === null) || (process.env.WS_URL === '')
? undefined
: process.env.WS_URL
: process.env.WS_URL;
console.log('process.env.WS_URL=', process.env.WS_URL);
console.log('Web socket url=', url);
createApp(App, {
url
});