Giter VIP home page Giter VIP logo

backstage-docker's Introduction

Backstage Docker

An easy to configure, Docker Compose for Backstage. Includes support for

  • Lets Encrypt ssl cert for https support, including http -> http2 redirect
  • Basic Auth, for restricted access
  • Postgres database on persistent volume
  • An OpenSSH server to publish TechDocs to.

Extended Documentation

This Docker compose setup depends on a Backstage app as described in Bringing up Backstage. That post has an extended description leading to this hosting setup.

Requirements

Infrastructure

  • Runs on any machine supporting Docker, e.g., Digital Ocean, AWS EC2, bare metal, etc.
  • No reliance on cloud storage (for TechDocs)
  • Access to DNS A or CNAME record (for https)

Prerequisites

TechDocs Publish SSH Keypair

You’ll need a public/private keypair to setup the TechDocs external publishing. I recommend you do not run the following on the server you’re hosting with, but on another, secure machine. It’s mostly important that you secure the private key, and not leave it lying around. Keeping it in your .ssh dir is ok. A password vault or manager is probably better, current events notwithstanding.

ssh-keygen -t rsa -b 4096 -N "" -C techdocs -f techdocs_rsa

Step by Step

  • Clone or copy this repo on your server
    git clone https://github.com/rmorison/backstage-docker.git
    cd backstage-docker
        
  • Create a .env file alongside the docker-compose.yml; start with the sample.env; see the Env Docs section below
    cp sample.env .env
    vi .env
        
  • Create a .htpasswd file with lines of output from the htpasswd program
    sudo apt install --yes apache2-utils
    htpasswd -bn backstage change-this-password >>.htpasswd
        
  • Point a domain to your server’s IP address via A or CNAME record (for Lets Encrypt certificate). That procedure is DNS provider specific, not covered here.
  • Bring up the docker cluster
    docker compose up --build
        
  • Visit your instance at your BACKSTAGE_DOMAIN setting
    • Import catalogs via the /catalog-import path
    • Publish TechDocs via your external workflows: GH Action example

Env Docs

  • TRAEFIK_API_INSECURE: true/false to enable/disable traefik dashboard on port 8080; you could setup an ssh tunnel to access
  • BACKSTAGE_APP_TITLE: the app.title setting in the Backstage app config
  • BACKSTAGE_ORGANIZATION_NAME: the organization.name setting in the Backstage app config
  • BACKSTAGE_DOMAIN: DNS A or CNAME that points to this server’s IP address
  • BACKSTAGE_IMAGE: Docker image path of Backstage app, e.g., ghcr.io/rmorison/backstage-app:latest
  • TECHDOCS_DIR: mount point of published TechDocs tree in containers, e.g., /techdocs
  • TECHDOCS_SSH_PUBLIC_KEY: ssh public key (be sure to quote) for scp from a TechDocs publish workflow
    • Tip: run ssh-keygen -t rsa -b 4096 -N "" -C techdocs -f techdocs_rsa, the contents of techdocs_rsa.pub goes here, the corresponding private key goes into the TECHDOCS_SSH_PRIVATE_KEY secret in the TechDocs publish workflow
    • Warning: store the private key file securely
  • TECHDOCS_UID: set to the account UID running docker compose, e.g., 1000 on EC2; for owner of ./techdocs tree
  • TECHDOCS_GID: set to the account GID running docker compose, e.g., 1000 on EC2; for owner of ./techdocs tree
  • POSTGRES_HOST: needs to match postgres container in docker-compose.yml, e.g., db
  • POSTGRES_PORT: default 5432
  • POSTGRES_USER: Postgres backstage database user
  • POSTGRES_PASSWORD: Postgres backstage database user password
  • LETSENCRYPT_ADMIN_EMAIL: Your admin email for Lets Encrypt cert

backstage-docker's People

Contributors

rmorison avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.