Skip to content

mathieu-benoit/deploy-backstage-with-score

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

378 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This Backstage application is used as part of these blog posts:

You can deploy this Backstage application in different ways:

With yarn

To start the app, run:

yarn install
yarn start

Then navigate to http://localhost:3000.

With docker/podman

By building new container images

docker image build -t backstage-backend:local .
docker run -d \
    -u 65532 \
    --cap-drop=ALL \
    --read-only \
    --tmpfs /tmp \
    -e APP_CONFIG_backend_database_client='better-sqlite3' \
    -e APP_CONFIG_backend_database_connection=':memory:' \
    -p 7007:7007 \
    backstage-backend:local

docker image build -f Dockerfile.frontend -t backstage-frontend:local .
docker run -d \
    -u 65532 \
    --cap-drop=ALL \
    -p 3000:8080 \
    backstage-frontend:local

By using the pre-built container image

docker run -d \
    -u 65532 \
    --cap-drop=ALL \
    --read-only \
    --tmpfs /tmp \
    -e APP_CONFIG_backend_database_client='better-sqlite3' \
    -e APP_CONFIG_backend_database_connection=':memory:' \
    -p 7007:7007 \
    ghcr.io/mathieu-benoit/backstage-backend:latest

docker run -d \
    -u 65532 \
    --cap-drop=ALL \
    -p 3000:8080 \
    ghcr.io/mathieu-benoit/backstage-frontend:latest

Then navigate to http://localhost:3000.

With score-compose

score-compose init --no-sample 	\
    --patch-templates https://raw.githubusercontent.com/score-spec/community-patchers/refs/heads/main/score-compose/unprivileged.tpl \
    --provisioners https://raw.githubusercontent.com/score-spec/community-provisioners/refs/heads/main/service/score-compose/10-service.provisioners.yaml

By building a new container image

score-compose generate score-backend.light.yaml \
    --build 'backend={"context":".","tags":["backstage-backend:local"]}'

score-compose generate score-frontend.light.yaml \
    --build 'frontend={"context":".","dockerfile":"Dockerfile.frontend","tags":["backstage-frontend:local"]}' \
    --publish 7007:backend:7007 \
    --publish 3000:frontend:8080

sudo yq e -i '.services.frontend-frontend.read_only = false' compose.yaml
docker compose up --build -d

By using the pre-built container image

score-compose generate score-backend.light.yaml \
    --image ghcr.io/mathieu-benoit/backstage-backend:latest

score-compose generate score-frontend.light.yaml \
    --image ghcr.io/mathieu-benoit/backstage-frontend:latest \
    --publish 7007:backend:7007 \
    --publish 3000:frontend:8080

sudo yq e -i '.services.frontend-frontend.read_only = false' compose.yaml
docker compose up -d

Then navigate to http://localhost:3000.

More advanced with score-compose and score-k8s

For more advanced setup, follow this blog post: Deploy Backstage with Score, from local to Kubernetes.