-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b38194
commit 0c581a6
Showing
24 changed files
with
13,864 additions
and
11,231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# syntax=docker/dockerfile:1.2 | ||
|
||
# Stage 1 - Create yarn install skeleton layer | ||
FROM node:18-bookworm-slim AS packages | ||
FROM node:20-bookworm-slim AS packages | ||
|
||
WORKDIR /app | ||
COPY package.json yarn.lock ./ | ||
|
@@ -14,17 +14,17 @@ COPY plugins plugins | |
RUN find packages \! -name "package.json" -mindepth 2 -maxdepth 2 -exec rm -rf {} \+ | ||
|
||
# Stage 2 - Install dependencies and build packages | ||
FROM node:18-bookworm-slim AS build | ||
FROM node:20-bookworm-slim AS build | ||
|
||
# Install isolate-vm dependencies, these are needed by the @backstage/plugin-scaffolder-backend. | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends python3 g++ build-essential && \ | ||
yarn config set python /usr/bin/python3 | ||
# Set Python interpreter for `node-gyp` to use | ||
ENV PYTHON /usr/bin/python3 | ||
|
||
# Install sqlite3 dependencies. You can skip this if you don't use sqlite3 in the image, | ||
# in which case you should also move better-sqlite3 to "devDependencies" in package.json. | ||
# Install system dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends libsqlite3-dev | ||
apt-get install -y --no-install-recommends python3 g++ build-essential libsqlite3-dev && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
corepack enable && \ | ||
corepack prepare [email protected] --activate | ||
|
||
USER node | ||
WORKDIR /app | ||
|
@@ -34,7 +34,8 @@ COPY --from=packages --chown=node:node /app . | |
ENV CYPRESS_CACHE_FOLDER /app/cypress_cache | ||
RUN mkdir -p /app/cypress_cache && chown -R node:node /app/cypress_cache | ||
|
||
RUN yarn install --frozen-lockfile --network-timeout 600000 | ||
RUN yarn workspaces focus --all --production && \ | ||
rm -rf "$(yarn cache clean)" | ||
|
||
COPY --chown=node:node . . | ||
|
||
|
@@ -48,34 +49,29 @@ RUN mkdir packages/backend/dist/skeleton packages/backend/dist/bundle \ | |
&& tar xzf packages/backend/dist/bundle.tar.gz -C packages/backend/dist/bundle | ||
|
||
# Stage 3 - Build the actual backend image and install production dependencies | ||
FROM node:18-bookworm-slim | ||
FROM node:20-bookworm-slim | ||
|
||
# Install isolate-vm dependencies, these are needed by the @backstage/plugin-scaffolder-backend. | ||
# Install system dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends python3 g++ build-essential git && \ | ||
yarn config set python /usr/bin/python3 | ||
apt-get install -y --no-install-recommends python3 g++ build-essential git libsqlite3-dev && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
corepack enable && \ | ||
corepack prepare [email protected] --activate | ||
|
||
# Install sqlite3 dependencies. You can skip this if you don't use sqlite3 in the image, | ||
# in which case you should also move better-sqlite3 to "devDependencies" in package.json. | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends libsqlite3-dev | ||
|
||
# From here on we use the least-privileged `node` user to run the backend. | ||
USER node | ||
|
||
# This should create the app dir as `node`. | ||
# If it is instead created as `root` then the `tar` command below will | ||
# fail: `can't create directory 'packages/': Permission denied`. | ||
# If this occurs, then ensure BuildKit is enabled (`DOCKER_BUILDKIT=1`) | ||
# so the app dir is correctly created as `node`. | ||
WORKDIR /app | ||
|
||
# Copy the install dependencies from the build stage and context | ||
COPY --from=build --chown=node:node /app/yarn.lock /app/package.json /app/packages/backend/dist/skeleton/ ./ | ||
|
||
RUN mkdir -p /app/cypress_cache && chown -R node:node /app/cypress_cache | ||
COPY --from=build --chown=node:node /app/.yarn ./.yarn | ||
COPY --from=build --chown=node:node /app/.yarnrc.yml ./ | ||
|
||
RUN yarn install --frozen-lockfile --production --network-timeout 600000 | ||
RUN --mount=type=cache,target=/home/node/.yarn/berry/cache,sharing=locked,uid=1000,gid=1000 \ | ||
yarn workspaces focus --all --production | ||
|
||
# Copy the built packages from the build stage | ||
COPY --from=build --chown=node:node /app/packages/backend/dist/bundle/ ./ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ yarn dev | |
``` | ||
|
||
To build container, run: | ||
|
||
```sh | ||
yarn tsc | ||
yarn build:backend | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"version": "1.29.2" | ||
"version": "1.30.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<!DOCTYPE html> | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,4 +106,4 @@ export default app.createRoot( | |
<Root>{routes}</Root> | ||
</AppRouter> | ||
</>, | ||
); | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,4 +93,4 @@ export const Root = ({ children }: PropsWithChildren<{}>) => ( | |
</Sidebar> | ||
{children} | ||
</SidebarPage> | ||
); | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -388,4 +388,4 @@ export const entityPage = ( | |
|
||
<EntitySwitch.Case>{defaultEntityPage}</EntitySwitch.Case> | ||
</EntitySwitch> | ||
); | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import '@backstage/cli/asset-types'; | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import ReactDOM from 'react-dom/client'; | ||
import App from './App'; | ||
|
||
ReactDOM.render(<App />, document.getElementById('root')); | ||
ReactDOM.createRoot(document.getElementById('root')!).render(<App />); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.