diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..2fac00fd6d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +.git +node_modules +packages/*/node_modules +packages/*/dist +plugins/*/node_modules +plugins/*/dist diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..39d51a35f2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM node:12 as builder +WORKDIR /app + +COPY package.json yarn.lock .yarnrc .npmrc /app/ +COPY .yarn /app/.yarn +COPY packages /app/packages +COPY plugins /app/plugins + +RUN yarn + +COPY . . + +RUN yarn build + +FROM nginx:mainline + +COPY --from=builder /app/packages/app/build /usr/share/nginx/html diff --git a/README.md b/README.md index 289e034e4f..28f9cfdece 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,17 @@ $ yarn start The final `yarn start` command should open a local instance of Backstage in your browser, otherwise open one of the URLs printed in the terminal. +### (Optional)Try on Docker + +Run the following commands if you have Docker environment + +```bash +$ docker build . -t spotify/backstage +$ docker run --rm -it -p 80:80 spotify/backstage +``` + +Then open http://localhost/ on your browser. + ## Documentation - [Create a Plugin](docs/getting-started/create-a-plugin.md)