From 76952ea307a82c5d9a5a88bc903ea20604ebae25 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 15 Jul 2020 10:47:25 +0200 Subject: [PATCH 1/7] feat(docker-compose): added a simple docker compose to get people started with example backend and frontend --- docker-compose.yaml | 16 +++++++++++ docs/getting-started/deployment-other.md | 27 +++++++++++++++++++ .../development-environment.md | 4 ++- package.json | 1 + 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 docker-compose.yaml diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000000..91177841e1 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,16 @@ +version: '3' + +services: + frontend: + image: 'spotify/backstage:latest' + ports: + - '3000:80' + environment: &environment + ROLLBAR_ACCOUNT_TOKEN: TOKEN + SENTRY_TOKEN: TOKEN + GITHUB_ACCESS_TOKEN: TOKEN + backend: + image: 'example-backend:latest' + ports: + - '7000:7000' + environment: *environment diff --git a/docs/getting-started/deployment-other.md b/docs/getting-started/deployment-other.md index e69de29bb2..81fb66e0a8 100644 --- a/docs/getting-started/deployment-other.md +++ b/docs/getting-started/deployment-other.md @@ -0,0 +1,27 @@ +# Deployment (Other) + +## Deploying Locally + +### Try on Docker + +Run the following commands if you have Docker environment + +```bash +$ yarn docker-build +$ docker run --rm -it -p 80:80 spotify/backstage +``` + +Then open http://localhost/ on your browser. + +### Running with `docker-compose` + +Run the following commands if you have docker and docker-compose for a full +example, with the example backend also deployed. + +```bash +$ yarn docker-build:all +$ docker-compose up +``` + +Then open http://localhost/ on your browser to see the example app with an +example backend. diff --git a/docs/getting-started/development-environment.md b/docs/getting-started/development-environment.md index 7f650b27e6..9d6c4aa691 100644 --- a/docs/getting-started/development-environment.md +++ b/docs/getting-started/development-environment.md @@ -80,7 +80,7 @@ yarn diff # Make sure all plugins are up to date with the latest plugin template yarn create-plugin # Create a new plugin ``` -### (Optional)Try on Docker +### (Optional) Try on Docker Run the following commands if you have Docker environment @@ -91,6 +91,8 @@ $ docker run --rm -it -p 80:80 spotify/backstage Then open http://localhost/ on your browser. +### (Optional) Running with Docker-Compose + > See [package.json](/package.json) for other yarn commands/options. [Next Step - Create a Backstage plugin](create-a-plugin.md) diff --git a/package.json b/package.json index cc45d541d4..9d702c4755 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "lint:all": "lerna run lint --", "lint:type-deps": "node scripts/check-type-dependencies.js", "docker-build": "yarn bundle && docker build . -t spotify/backstage", + "docker-build:all": "yarn tsc && yarn build && yarn docker-build && yarn workspace example-backend build-image", "create-plugin": "backstage-cli create-plugin", "remove-plugin": "backstage-cli remove-plugin", "release": "if [ \"$(git symbolic-ref --short HEAD)\" = master ]; then echo \"don't try to release master\"; exit 1; else lerna version --no-push; fi", From 13762a04052f237e1239658c6a4bfe85112e052a Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 15 Jul 2020 10:51:42 +0200 Subject: [PATCH 2/7] docs(getting-started): remove the docker stuff from development and move to deployment local instead --- docs/getting-started/development-environment.md | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/docs/getting-started/development-environment.md b/docs/getting-started/development-environment.md index 9d6c4aa691..86337e21e0 100644 --- a/docs/getting-started/development-environment.md +++ b/docs/getting-started/development-environment.md @@ -80,19 +80,6 @@ yarn diff # Make sure all plugins are up to date with the latest plugin template yarn create-plugin # Create a new plugin ``` -### (Optional) Try on Docker - -Run the following commands if you have Docker environment - -```bash -$ yarn docker-build -$ docker run --rm -it -p 80:80 spotify/backstage -``` - -Then open http://localhost/ on your browser. - -### (Optional) Running with Docker-Compose - > See [package.json](/package.json) for other yarn commands/options. [Next Step - Create a Backstage plugin](create-a-plugin.md) From 340027091f79aa24a5f02d4ef9a7299f38e1d1bd Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 15 Jul 2020 14:48:41 +0200 Subject: [PATCH 3/7] chore(docker-compose): move env --- docker-compose.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 91177841e1..2b725370cc 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -5,12 +5,12 @@ services: image: 'spotify/backstage:latest' ports: - '3000:80' - environment: &environment - ROLLBAR_ACCOUNT_TOKEN: TOKEN - SENTRY_TOKEN: TOKEN - GITHUB_ACCESS_TOKEN: TOKEN + backend: image: 'example-backend:latest' ports: - '7000:7000' - environment: *environment + environment: + ROLLBAR_ACCOUNT_TOKEN: TOKEN + SENTRY_TOKEN: TOKEN + GITHUB_ACCESS_TOKEN: TOKEN From 96e0c6c1cdeb7baef2abe7c83772153e252ee5ca Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 15 Jul 2020 15:13:25 +0200 Subject: [PATCH 4/7] chore(docker-compose): set node-env --- docker-compose.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 2b725370cc..63b7287e1a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -11,6 +11,4 @@ services: ports: - '7000:7000' environment: - ROLLBAR_ACCOUNT_TOKEN: TOKEN - SENTRY_TOKEN: TOKEN - GITHUB_ACCESS_TOKEN: TOKEN + NODE_ENV: development From 66cb5b29b55bb44cb8302f0f22fa3752f3f82dd1 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 15 Jul 2020 15:14:15 +0200 Subject: [PATCH 5/7] chore(docker-compose): added some more stuff --- docker-compose.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker-compose.yaml b/docker-compose.yaml index 63b7287e1a..651c2d2372 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,3 +1,6 @@ +# Make sure that before you +# run the docker-compose that you have run +# $ yarn docker-build:all version: '3' services: From 4fa58331ba0032ab4a60db382b814307ba7996f3 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 15 Jul 2020 15:16:10 +0200 Subject: [PATCH 6/7] chore(docker-compose): remove line --- docker-compose.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 651c2d2372..d32928b4e3 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -8,7 +8,6 @@ services: image: 'spotify/backstage:latest' ports: - '3000:80' - backend: image: 'example-backend:latest' ports: From 74e1cc5d961fcc6af98f6103567b453ed89962d3 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 15 Jul 2020 15:55:08 +0200 Subject: [PATCH 7/7] docs(deployment): fixing documentation --- docs/getting-started/deployment-other.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting-started/deployment-other.md b/docs/getting-started/deployment-other.md index 81fb66e0a8..26c70acac4 100644 --- a/docs/getting-started/deployment-other.md +++ b/docs/getting-started/deployment-other.md @@ -23,5 +23,5 @@ $ yarn docker-build:all $ docker-compose up ``` -Then open http://localhost/ on your browser to see the example app with an +Then open http://localhost:3000 on your browser to see the example app with an example backend.