Commit e3845e14 authored by Richard Blechinger's avatar Richard Blechinger
Browse files

Merge branch 'feature/docker'

parents 1023aee9 95330209
# all dev/prod specific env files; we have sample.env.* as templates
FROM node:lts-alpine AS base
COPY package*.json ./
RUN npm install
FROM base AS dev
CMD ["npm", "run", "serve"]
FROM base AS prod
COPY . .
CMD ["npm", "run", "build"]
......@@ -74,6 +74,44 @@ recommended).
> TODO: provide an example setup
### Building/running with Docker
You can use Docker either to run the local development server, if you do not
want to set up node/npm on your host, or you can use Docker to just build the
_dist_ directory, that you then use in your dashboard's web root.
Before you build any image and run containers, make sure you followed the
steps above in the _Configuration_ section.
To create the image for the dev container and run it use the following:
docker build -t dashboard-dev --target=dev .
docker run --rm -it -v $(pwd):/aura -p 8080:8080 dashboard-dev
To use the build image to build the _dist_ directory do the following:
docker build -t dashboard --target=prod .
docker run --rm -it -v "$(pwd)"/dist_docker:/aura/dist_docker dashboard \
sh -c 'npm run build && mv dist/* dist_docker'
In this case the final result will be put into the `dist_docker` directory, so
you can have different builds through docker and a local dev setup.
If you do not use any local dev setup and want to get the built files directly
into the `dist` directory, just change the `"$(pwd)"/dist_docker` in the volume
option to `"$(pwd)"/dist`. (If you are wondering why inside the container we
copy everything from the `dist` to the `dist_docker` container: this is a
workaround, because the build process needs the `dist` directory unlocked,
which is not the case if we bind it to a volume)
A more comprehensive setup in combination with other AuRa components can be
found in the [meta repository](
## Common problems and solutions
### Access to steering is denied due to CORS issues
npm run build
rm -r dist_docker/*
cp -a dist/* dist_docker
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment