Skip to content

Commit 36599f9

Browse files
committed
Required docker configuration completed
1 parent 229ad29 commit 36599f9

File tree

3 files changed

+142
-2
lines changed

3 files changed

+142
-2
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ dist-types
22
node_modules
33
packages/*/dist
44
packages/*/node_modules
5+
packages/backend/.env
56
plugins/*/dist
67
plugins/*/node_modules
78
*.local.yaml

Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# DO NOT USE THIS IN PRODUCTION
2+
#
3+
# This Dockerfile builds a Docker image for a pre-configured Backstage instance
4+
# with the Stack Overflow plugins installed. It’s designed as a quick way to try
5+
# out the integration without having to set it up yourself.
6+
#
7+
# This is not intended for production use.
8+
19
# Stage 1 - Create yarn install skeleton layer
210
FROM node:20-bookworm-slim AS packages
311

@@ -105,9 +113,9 @@ COPY --chown=node:node app-config*.yaml ./
105113
COPY --chown=node:node examples ./examples
106114

107115
# This switches many Node.js dependencies to production mode.
108-
ENV NODE_ENV=production
116+
ENV NODE_ENV=development
109117

110118
# This disables node snapshot for Node 20 to work with the Scaffolder
111119
ENV NODE_OPTIONS="--no-node-snapshot"
112120

113-
CMD ["node", "packages/backend", "--config", "app-config.yaml", "--config", "app-config.production.yaml"]
121+
CMD ["node", "packages/backend", "--config", "app-config.docker-local.yaml"]

app-config.docker-local.yaml

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# DO NOT USE THIS IN PRODUCTION.
2+
#
3+
# This app-config is used to run a development environment with Docker.
4+
# It resembles the app-config.yaml file which is not intended for production use.
5+
6+
app:
7+
title: Scaffolded Backstage App
8+
baseUrl: http://localhost:7007
9+
10+
organization:
11+
name: My Company
12+
13+
stackoverflow:
14+
baseUrl: ${STACK_OVERFLOW_INSTANCE_URL}
15+
# teamName: ${STACK_OVERFLOW_TEAM_NAME}
16+
17+
apiAccessToken: ${STACK_OVERFLOW_API_ACCESS_TOKEN}
18+
# The API Access Token is used for the Questions' collator, a no-expiry, read-only token is recommended.
19+
20+
clientId: ${STACK_OVERFLOW_CLIENT_ID}
21+
# The clientid must be for an API Application with read-write access.
22+
23+
redirectUri: ${STACK_OVERFLOW_REDIRECT_URI}
24+
# If no redirectUri is specified this will return to https://<backstage-domain>/stack-overflow-teams
25+
26+
backend:
27+
# Used for enabling authentication, secret is shared by all backend plugins
28+
# See https://backstage.io/docs/auth/service-to-service-auth for
29+
# information on the format
30+
# auth:
31+
# keys:
32+
# - secret: ${BACKEND_SECRET}
33+
baseUrl: http://localhost:7007
34+
listen:
35+
port: 7007
36+
# Uncomment the following host directive to bind to specific interfaces
37+
# host: 127.0.0.1
38+
csp:
39+
connect-src: ["'self'", 'http:', 'https:']
40+
# Content-Security-Policy directives follow the Helmet format: https://helmetjs.github.io/#reference
41+
# Default Helmet Content-Security-Policy values can be removed by setting the key to false
42+
cors:
43+
origin: http://localhost:7007
44+
methods: [GET, HEAD, PATCH, POST, PUT, DELETE]
45+
credentials: true
46+
# This is for local development only, it is not recommended to use this in production
47+
# The production database configuration is stored in app-config.production.yaml
48+
database:
49+
client: better-sqlite3
50+
connection: ':memory:'
51+
# workingDirectory: /tmp # Use this to configure a working directory for the scaffolder, defaults to the OS temp-dir
52+
53+
integrations:
54+
github:
55+
- host: github.com
56+
# This is a Personal Access Token or PAT from GitHub. You can find out how to generate this token, and more information
57+
# about setting up the GitHub integration here: https://backstage.io/docs/integrations/github/locations#configuration
58+
token: ${GITHUB_TOKEN}
59+
### Example for how to add your GitHub Enterprise instance using the API:
60+
# - host: ghe.example.net
61+
# apiBaseUrl: https://ghe.example.net/api/v3
62+
# token: ${GHE_TOKEN}
63+
64+
proxy:
65+
### Example for how to add a proxy endpoint for the frontend.
66+
### A typical reason to do this is to handle HTTPS and CORS for internal services.
67+
# endpoints:
68+
# '/test':
69+
# target: 'https://example.com'
70+
# changeOrigin: true
71+
72+
# Reference documentation http://backstage.io/docs/features/techdocs/configuration
73+
# Note: After experimenting with basic setup, use CI/CD to generate docs
74+
# and an external cloud storage when deploying TechDocs for production use-case.
75+
# https://backstage.io/docs/features/techdocs/how-to-guides#how-to-migrate-from-techdocs-basic-to-recommended-deployment-approach
76+
techdocs:
77+
builder: 'local' # Alternatives - 'external'
78+
generator:
79+
runIn: 'docker' # Alternatives - 'local'
80+
publisher:
81+
type: 'local' # Alternatives - 'googleGcs' or 'awsS3'. Read documentation for using alternatives.
82+
83+
auth:
84+
# see https://backstage.io/docs/auth/ to learn about auth providers
85+
providers:
86+
# See https://backstage.io/docs/auth/guest/provider
87+
guest: {}
88+
89+
scaffolder:
90+
# see https://backstage.io/docs/features/software-templates/configuration for software template options
91+
92+
catalog:
93+
import:
94+
entityFilename: catalog-info.yaml
95+
pullRequestBranchName: backstage-integration
96+
rules:
97+
- allow: [Component, System, API, Resource, Location]
98+
locations:
99+
# Local example data, file locations are relative to the backend process, typically `packages/backend`
100+
- type: file
101+
target: ../../examples/entities.yaml
102+
103+
# Local example template
104+
- type: file
105+
target: ../../examples/template/template.yaml
106+
rules:
107+
- allow: [Template]
108+
109+
# Local example organizational data
110+
- type: file
111+
target: ../../examples/org.yaml
112+
rules:
113+
- allow: [User, Group]
114+
115+
## Uncomment these lines to add more example data
116+
# - type: url
117+
# target: https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/all.yaml
118+
119+
## Uncomment these lines to add an example org
120+
# - type: url
121+
# target: https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/acme-corp.yaml
122+
# rules:
123+
# - allow: [User, Group]
124+
125+
kubernetes:
126+
# see https://backstage.io/docs/features/kubernetes/configuration for kubernetes configuration options
127+
128+
# see https://backstage.io/docs/permissions/getting-started for more on the permission framework
129+
permission:
130+
# setting this to `false` will disable permissions
131+
enabled: true

0 commit comments

Comments
 (0)