forked from sigstore/rekor-search-ui
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decrease the size of the Dockerfile (#81)
- Loading branch information
Showing
11 changed files
with
142 additions
and
153 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,38 @@ | ||
FROM registry.access.redhat.com/ubi9/nodejs-20@sha256:885a9ae3a7fcd8e24ab7a35ef344a30481a42c37ab5cf41339d8bcba46857cb1 as Build | ||
# | ||
COPY . . | ||
# Builder Stage | ||
FROM registry.access.redhat.com/ubi9/nodejs-20-minimal@sha256:129108930931cff55453cc6f54db1984f484a9d8f62dfbd9d25b4175e1ba7802 as builder | ||
USER root | ||
EXPOSE 3000 | ||
RUN echo "export PATH=${PATH}:$HOME/node_modules/.bin" >> ~/.bashrc && \ | ||
npm install --ignore-scripts && \ | ||
npm run build && \ | ||
chmod -R 777 /opt/app-root/src/.npm && \ | ||
echo "NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN = ${NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN}" && \ | ||
npm cache clean --force | ||
|
||
COPY package.json package-lock.json ./ | ||
RUN npm pkg delete scripts.prepare | ||
RUN npm ci --ignore-scripts --network-timeout=100000 || \ | ||
(echo "Retrying npm ci" && sleep 5 && npm ci --ignore-scripts \ | ||
--network-timeout=100000) || \ | ||
(echo "Retrying npm ci again" && sleep 5 && npm ci --ignore-scripts \ | ||
--network-timeout=100000) | ||
COPY . . | ||
RUN npm run build | ||
|
||
# Production Stage | ||
FROM registry.access.redhat.com/ubi9/nodejs-20-minimal@sha256:129108930931cff55453cc6f54db1984f484a9d8f62dfbd9d25b4175e1ba7802 as production | ||
USER 1001 | ||
CMD ["node_modules/.bin/next", "start"] | ||
EXPOSE 3000 | ||
|
||
LABEL \ | ||
com.redhat.component="trusted-artifact-signer-rekor-ui" \ | ||
name="trusted-artifact-signer-rekor-ui" \ | ||
version="0.0.1" \ | ||
summary="User Interface for checking Rekor Entries" \ | ||
description="Provides a user interface for checking Rekor Entries through a Node App" \ | ||
io.k8s.description="Provides a user interface for checking Rekor Entries through a Node App" \ | ||
io.k8s.display-name="Provides a user interface for checking Rekor Entries through a Node App" \ | ||
io.openshift.tags="rekor-ui, rekor, cli, rhtas, trusted, artifact, signer, sigstore" \ | ||
maintainer="[email protected]" | ||
com.redhat.component="trusted-artifact-signer-rekor-ui" \ | ||
name="trusted-artifact-signer-rekor-ui" \ | ||
version="0.0.1" \ | ||
summary="User Interface for checking Rekor Entries" \ | ||
description="Provides a user interface for checking Rekor Entries through a Node App" \ | ||
io.k8s.description="Provides a user interface for checking Rekor Entries through a Node App" \ | ||
io.k8s.display-name="Provides a user interface for checking Rekor Entries through a Node App" \ | ||
io.openshift.tags="rekor-ui, rekor, cli, rhtas, trusted, artifact, signer, sigstore" \ | ||
maintainer="[email protected]" | ||
|
||
COPY --from=builder /opt/app-root/src/package.json . | ||
COPY --from=builder /opt/app-root/src/package-lock.json . | ||
COPY --from=builder /opt/app-root/src/next.config.js ./ | ||
COPY --from=builder /opt/app-root/src/public ./public | ||
COPY --from=builder /opt/app-root/src/.next/standalone ./ | ||
COPY --from=builder /opt/app-root/src/.next/static ./.next/static | ||
|
||
CMD ["node", "server.js"] |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
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,20 +1,8 @@ | ||
import type { AppProps } from "next/app"; | ||
import "@patternfly/react-core/dist/styles/base.css"; | ||
import { NextPageContext } from "next"; | ||
|
||
function App({ Component, pageProps }: AppProps) { | ||
return <Component {...pageProps} />; | ||
} | ||
|
||
App.getInitialProps = async (_ctx: NextPageContext) => { | ||
return { | ||
props: { | ||
NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN: process.env | ||
.NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN | ||
? process.env.NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN | ||
: null, | ||
}, // gets passed to the page component as props | ||
}; | ||
}; | ||
|
||
export default App; |
Oops, something went wrong.