mirror of
https://github.com/louislam/dockge.git
synced 2025-03-12 20:34:47 +00:00
Compare commits
4 commits
10fb5e1f9b
...
010de81f3f
Author | SHA1 | Date | |
---|---|---|---|
|
010de81f3f | ||
|
a65a9f5549 | ||
|
9b73e44cd9 | ||
|
92170540c6 |
5 changed files with 62 additions and 28 deletions
|
@ -9,9 +9,9 @@ tmp
|
|||
|
||||
# Docker extra
|
||||
docker
|
||||
frontend
|
||||
.editorconfig
|
||||
.eslintrc.cjs
|
||||
.git
|
||||
.gitignore
|
||||
README.md
|
||||
.github
|
||||
*.md
|
||||
|
|
|
@ -236,42 +236,63 @@ export function copyYAMLComments(doc : Document, src : Document) {
|
|||
|
||||
/**
|
||||
* Copy yaml comments from srcItems to items
|
||||
* Typescript is super annoying here, so I have to use any here
|
||||
* TODO: Since comments are belong to the array index, the comments will be lost if the order of the items is changed or removed or added.
|
||||
* Attempts to preserve comments by matching content rather than just array indices
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function copyYAMLCommentsItems(items : any, srcItems : any) {
|
||||
function copyYAMLCommentsItems(items: any, srcItems: any) {
|
||||
if (!items || !srcItems) {
|
||||
return;
|
||||
}
|
||||
|
||||
// First pass - try to match items by their content
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const item : any = items[i];
|
||||
const item: any = items[i];
|
||||
|
||||
// Try to find matching source item by content
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const srcItem : any = srcItems[i];
|
||||
const srcIndex = srcItems.findIndex((srcItem: any) =>
|
||||
JSON.stringify(srcItem.value) === JSON.stringify(item.value) &&
|
||||
JSON.stringify(srcItem.key) === JSON.stringify(item.key)
|
||||
);
|
||||
|
||||
if (!srcItem) {
|
||||
continue;
|
||||
}
|
||||
if (srcIndex !== -1) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const srcItem: any = srcItems[srcIndex];
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const nextSrcItem: any = srcItems[srcIndex + 1];
|
||||
|
||||
if (item.key && srcItem.key) {
|
||||
item.key.comment = srcItem.key.comment;
|
||||
item.key.commentBefore = srcItem.key.commentBefore;
|
||||
}
|
||||
if (item.key && srcItem.key) {
|
||||
item.key.comment = srcItem.key.comment;
|
||||
item.key.commentBefore = srcItem.key.commentBefore;
|
||||
}
|
||||
|
||||
if (srcItem.comment) {
|
||||
item.comment = srcItem.comment;
|
||||
}
|
||||
if (srcItem.comment) {
|
||||
item.comment = srcItem.comment;
|
||||
}
|
||||
|
||||
if (item.value && srcItem.value) {
|
||||
if (typeof item.value === "object" && typeof srcItem.value === "object") {
|
||||
item.value.comment = srcItem.value.comment;
|
||||
item.value.commentBefore = srcItem.value.commentBefore;
|
||||
// Handle comments between array items
|
||||
if (nextSrcItem && nextSrcItem.commentBefore) {
|
||||
if (items[i + 1]) {
|
||||
items[i + 1].commentBefore = nextSrcItem.commentBefore;
|
||||
}
|
||||
}
|
||||
|
||||
if (item.value.items && srcItem.value.items) {
|
||||
copyYAMLCommentsItems(item.value.items, srcItem.value.items);
|
||||
// Handle trailing comments after array items
|
||||
if (srcItem.value && srcItem.value.comment) {
|
||||
if (item.value) {
|
||||
item.value.comment = srcItem.value.comment;
|
||||
}
|
||||
}
|
||||
|
||||
if (item.value && srcItem.value) {
|
||||
if (typeof item.value === "object" && typeof srcItem.value === "object") {
|
||||
item.value.comment = srcItem.value.comment;
|
||||
item.value.commentBefore = srcItem.value.commentBefore;
|
||||
|
||||
if (item.value.items && srcItem.value.items) {
|
||||
copyYAMLCommentsItems(item.value.items, srcItem.value.items);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
services:
|
||||
dockge:
|
||||
image: louislam/dockge:1
|
||||
build:
|
||||
context: .
|
||||
dockerfile: docker/Dockerfile
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
# Host Port : Container Port
|
||||
|
|
|
@ -4,9 +4,19 @@
|
|||
FROM louislam/dockge:build-healthcheck AS build_healthcheck
|
||||
|
||||
############################################
|
||||
# Build
|
||||
# Build frontend
|
||||
############################################
|
||||
FROM louislam/dockge:base AS build
|
||||
FROM louislam/dockge:base AS build_frontend
|
||||
WORKDIR /app
|
||||
COPY --chown=node:node . .
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
||||
pnpm install && \
|
||||
pnpm run build:frontend
|
||||
|
||||
############################################
|
||||
# Install node modules
|
||||
############################################
|
||||
FROM louislam/dockge:base AS build_nodemodules
|
||||
WORKDIR /app
|
||||
COPY --chown=node:node ./package.json ./package.json
|
||||
COPY --chown=node:node ./pnpm-lock.yaml ./pnpm-lock.yaml
|
||||
|
@ -18,8 +28,9 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-l
|
|||
FROM louislam/dockge:base AS release
|
||||
WORKDIR /app
|
||||
COPY --chown=node:node --from=build_healthcheck /app/extra/healthcheck /app/extra/healthcheck
|
||||
COPY --from=build /app/node_modules /app/node_modules
|
||||
COPY --chown=node:node . .
|
||||
COPY --from=build_frontend /app/frontend-dist /app/frontend-dist
|
||||
COPY --from=build_nodemodules /app/node_modules /app/node_modules
|
||||
COPY --chown=node:node . .
|
||||
RUN mkdir ./data
|
||||
|
||||
|
||||
|
|
|
@ -247,7 +247,6 @@ export default {
|
|||
<style scoped lang="scss">
|
||||
.main-terminal {
|
||||
height: 100%;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue