Skip to content

Commit 477ff64

Browse files
committed
chore: update Dockerfile(s) & allow build on arm
1 parent 0f98d80 commit 477ff64

File tree

58 files changed

+1557
-983
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1557
-983
lines changed

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
node_modules/
22
README.md
3+
.github
4+
.husky
5+
.lintstagedrc
6+
LICENSE
7+
.vscode/
8+
.prettierrc.js

.husky/pre-commit

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@
1717

1818
. "$(dirname "$0")/_/husky.sh"
1919

20-
# TODO: add lint-staged
21-
pnpm -r lint
20+
# TODO: add lint-staged && use pnpm -r lint (not working due to eslint & its ignorefile)
21+
pnpm --filter web lint
22+
pnpm --filter @devtron-labs/devtron-fe-common-lib lint
23+
pnpm --filter @devtron-labs/devtron-fe-lib lint

Dockerfile.storybook

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
FROM node:20-alpine AS builder
2+
ENV PNPM_HOME="/pnpm"
3+
ENV PATH="$PNPM_HOME:$PATH"
4+
RUN corepack enable
25

36
WORKDIR /app
4-
COPY package.json .
5-
COPY yarn.lock .
6-
7-
RUN yarn install --network-timeout 600000
87

98
COPY . .
109

11-
RUN yarn build-storybook
10+
RUN pnpm i --frozen-lockfile
11+
12+
RUN pnpm --filter=web build-storybook
1213

1314
FROM nginx:stable
1415

15-
COPY --from=builder /app/storybook-static/ /usr/share/nginx/html
16+
COPY --from=builder /app/apps/web/storybook-static/ /usr/share/nginx/html
1617
WORKDIR /usr/share/nginx/html
1718

1819
CMD ["/bin/bash", "-c", "nginx -g \"daemon off;\""]

Dockerfile renamed to Dockerfile.web

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
11
FROM node:20-alpine AS builder
2+
ENV PNPM_HOME="/pnpm"
3+
ENV PATH="$PNPM_HOME:$PATH"
4+
RUN corepack enable
25

36
WORKDIR /app
4-
COPY package.json .
5-
COPY yarn.lock .
67

7-
RUN yarn install --network-timeout 600000
8-
9-
COPY src/ src
10-
COPY nginx.conf .
11-
COPY tsconfig.json .
12-
COPY vite.config.mts .
138
COPY . .
149

1510
RUN echo `git rev-parse --short HEAD` > health.html
16-
RUN yarn build
11+
12+
RUN pnpm i --frozen-lockfile
13+
RUN pnpm run build:prod
1714

1815
FROM nginx:stable
1916

2017
RUN useradd -ms /bin/bash devtron
21-
COPY --from=builder /app/dist/ /usr/share/nginx/html
22-
COPY ./nginx.conf /etc/nginx/nginx.conf
23-
COPY ./nginx-default.conf /etc/nginx/conf.d/default.conf
18+
19+
COPY --from=builder /app/apps/web/dist/ /usr/share/nginx/html
20+
COPY --from=builder /app/apps/web/nginx.conf /etc/nginx/nginx.conf
21+
COPY --from=builder /app/apps/web/nginx-default.conf /etc/nginx/conf.d/default.conf
22+
2423
WORKDIR /usr/share/nginx/html
25-
COPY --from=builder /app/./env.sh .
26-
COPY --from=builder /app/.env .
24+
COPY --from=builder /app/apps/web/./env.sh .
25+
COPY --from=builder /app/apps/web/.env .
2726
COPY --from=builder /app/health.html .
2827

2928
RUN chown -R devtron:devtron /usr/share/nginx/html

apps/web/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentConfigCompare/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ export const getManifestRequestValues = (config: AppEnvDeploymentConfigDTO): { d
292292
null
293293

294294
return {
295-
data: _data ? YAMLStringify(_data) ?? '' : '',
295+
data: _data ? (YAMLStringify(_data) ?? '') : '',
296296
chartRefId: getDraftConfigChartRefId(config),
297297
}
298298
}

apps/web/src/components/app/details/cIDetails/CISecurity.utils.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const useGetCISecurityDetails = ({
4040

4141
const severityCount: SeverityCount = isSecurityScanV2Enabled
4242
? getSeverityCountFromSummary(scanResultResponse?.result.imageScan.vulnerability?.summary.severities)
43-
: executionDetailsResponse?.result.severityCount ?? { critical: 0, high: 0, medium: 0, low: 0, unknown: 0 }
43+
: (executionDetailsResponse?.result.severityCount ?? { critical: 0, high: 0, medium: 0, low: 0, unknown: 0 })
4444

4545
const totalCount = getTotalSeverityCount(severityCount)
4646

apps/web/src/components/app/details/triggerView/PipelineConfigDiff/utils.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export const parseCompareWithSearchParams =
105105

106106
export const getPipelineDeploymentConfigFromPromiseSettled = (
107107
res: PromiseSettledResult<ResponseType<AppEnvDeploymentConfigDTO>>,
108-
) => (res.status === 'fulfilled' ? res.value?.result ?? null : null)
108+
) => (res.status === 'fulfilled' ? (res.value?.result ?? null) : null)
109109

110110
export const getPipelineDeploymentConfigErrFromPromiseSettled = (
111111
res: PromiseSettledResult<ResponseType<AppEnvDeploymentConfigDTO>>,

apps/web/src/components/app/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
ReleaseMode,
2828
HelmReleaseStatus,
2929
} from '@devtron-labs/devtron-fe-common-lib'
30-
import { RouteComponentProps } from 'react-router'
30+
import { RouteComponentProps } from 'react-router-dom'
3131
import { AppEnvironment } from '../../services/service.types'
3232
import { DeploymentStatusDetailsBreakdownDataType, ErrorItem } from './details/appDetails/appDetails.type'
3333
import { GroupFilterType } from '../ApplicationGroup/AppGroup.types'

apps/web/vite.config.mts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { VitePWA } from 'vite-plugin-pwa'
2929
import tsconfigPaths from 'vite-tsconfig-paths'
3030

3131
const WRONG_CODE = `import { bpfrpt_proptype_WindowScroller } from "../WindowScroller.js";`
32-
const TARGET_URL = 'https://preview.devtron.ai/'
32+
const TARGET_URL = 'https://devtron-ent-7.devtron.info/'
3333

3434
function reactVirtualized(): PluginOption {
3535
return {
@@ -97,6 +97,13 @@ export default defineConfig(({ mode }) => {
9797
base: '/dashboard',
9898
preview: {
9999
port: 3000,
100+
proxy: {
101+
'/orchestrator': {
102+
target: TARGET_URL,
103+
changeOrigin: true,
104+
},
105+
'/grafana': TARGET_URL,
106+
},
100107
},
101108
build: {
102109
rollupOptions: {

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
"name": "devtron-frontend",
33
"version": "1.0.0",
44
"scripts": {
5-
"build": "pnpm run -r build",
6-
"lint": "pnpm run -r lint"
5+
"prepare": "husky install",
6+
"lint": "pnpm run -r lint",
7+
"build:prod": "pnpm run -r build",
8+
"build:libs": "pnpm filter './packages/**' build"
79
},
810
"devDependencies": {
911
"husky": "^7.0.4"

0 commit comments

Comments
 (0)