mirror of
https://github.com/louislam/dockge.git
synced 2024-11-30 22:24:03 +00:00
wip
This commit is contained in:
parent
eb6db8b31e
commit
a12c6dc033
10 changed files with 69 additions and 1005 deletions
|
@ -3,6 +3,7 @@
|
||||||
node_modules
|
node_modules
|
||||||
.idea
|
.idea
|
||||||
data
|
data
|
||||||
|
stacks
|
||||||
tmp
|
tmp
|
||||||
/private
|
/private
|
||||||
|
|
||||||
|
@ -11,5 +12,6 @@ docker
|
||||||
frontend
|
frontend
|
||||||
.editorconfig
|
.editorconfig
|
||||||
.eslintrc.cjs
|
.eslintrc.cjs
|
||||||
|
.git
|
||||||
.gitignore
|
.gitignore
|
||||||
README.md
|
README.md
|
||||||
|
|
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -1,10 +1,12 @@
|
||||||
# Should update .dockerignore as well
|
# Should update .dockerignore as well
|
||||||
.env
|
.env
|
||||||
node_modules
|
node_modules
|
||||||
dist
|
|
||||||
frontend-dist
|
|
||||||
.idea
|
.idea
|
||||||
data
|
data
|
||||||
|
stacks
|
||||||
tmp
|
tmp
|
||||||
/private
|
/private
|
||||||
|
|
||||||
|
# Git only
|
||||||
|
frontend-dist
|
||||||
|
|
||||||
|
|
|
@ -81,6 +81,14 @@ export class DockgeServer {
|
||||||
// Log NODE ENV
|
// Log NODE ENV
|
||||||
log.info("server", "NODE_ENV: " + process.env.NODE_ENV);
|
log.info("server", "NODE_ENV: " + process.env.NODE_ENV);
|
||||||
|
|
||||||
|
// Default stacks directory
|
||||||
|
let defaultStacksDir;
|
||||||
|
if (process.platform === "win32") {
|
||||||
|
defaultStacksDir = "./stacks";
|
||||||
|
} else {
|
||||||
|
defaultStacksDir = "/opt/stacks";
|
||||||
|
}
|
||||||
|
|
||||||
// Define all possible arguments
|
// Define all possible arguments
|
||||||
let args = parse<Arguments>({
|
let args = parse<Arguments>({
|
||||||
sslKey: {
|
sslKey: {
|
||||||
|
@ -106,6 +114,10 @@ export class DockgeServer {
|
||||||
dataDir: {
|
dataDir: {
|
||||||
type: String,
|
type: String,
|
||||||
optional: true,
|
optional: true,
|
||||||
|
},
|
||||||
|
stacksDir: {
|
||||||
|
type: String,
|
||||||
|
optional: true,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -118,6 +130,8 @@ export class DockgeServer {
|
||||||
this.config.port = args.port || parseInt(process.env.DOCKGE_PORT) || 5001;
|
this.config.port = args.port || parseInt(process.env.DOCKGE_PORT) || 5001;
|
||||||
this.config.hostname = args.hostname || process.env.DOCKGE_HOSTNAME || undefined;
|
this.config.hostname = args.hostname || process.env.DOCKGE_HOSTNAME || undefined;
|
||||||
this.config.dataDir = args.dataDir || process.env.DOCKGE_DATA_DIR || "./data/";
|
this.config.dataDir = args.dataDir || process.env.DOCKGE_DATA_DIR || "./data/";
|
||||||
|
this.config.stacksDir = args.stacksDir || process.env.DOCKGE_STACKS_DIR || defaultStacksDir;
|
||||||
|
this.stacksDir = this.config.stacksDir;
|
||||||
|
|
||||||
log.debug("server", this.config);
|
log.debug("server", this.config);
|
||||||
|
|
||||||
|
@ -406,7 +420,6 @@ export class DockgeServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create data/stacks directory
|
// Create data/stacks directory
|
||||||
this.stacksDir = path.join(this.config.dataDir, "stacks");
|
|
||||||
if (!fs.existsSync(this.stacksDir)) {
|
if (!fs.existsSync(this.stacksDir)) {
|
||||||
fs.mkdirSync(this.stacksDir, { recursive: true });
|
fs.mkdirSync(this.stacksDir, { recursive: true });
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,11 +64,7 @@ export class Stack {
|
||||||
}
|
}
|
||||||
|
|
||||||
get isManagedByDockge() : boolean {
|
get isManagedByDockge() : boolean {
|
||||||
if (this._configFilePath) {
|
return fs.existsSync(this.path) && fs.statSync(this.path).isDirectory();
|
||||||
return this._configFilePath.startsWith(this.server.stackDirFullPath) && fs.existsSync(this.path) && fs.statSync(this.path).isDirectory();
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get status() : number {
|
get status() : number {
|
||||||
|
|
|
@ -19,11 +19,13 @@ export interface Arguments {
|
||||||
port? : number;
|
port? : number;
|
||||||
hostname? : string;
|
hostname? : string;
|
||||||
dataDir? : string;
|
dataDir? : string;
|
||||||
|
stacksDir? : string;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Some config values are required
|
// Some config values are required
|
||||||
export interface Config extends Arguments {
|
export interface Config extends Arguments {
|
||||||
dataDir : string;
|
dataDir : string;
|
||||||
|
stacksDir : string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function checkLogin(socket : DockgeSocket) {
|
export function checkLogin(socket : DockgeSocket) {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
# docker run -d --name dockge -p 5001:5001 -v dockge:/app/data -v /var/run/docker.sock:/var/run/docker.sock --restart=always louislam/dockge:nightly
|
|
||||||
version: "3.8"
|
version: "3.8"
|
||||||
services:
|
services:
|
||||||
dockge:
|
dockge:
|
||||||
|
@ -6,5 +5,8 @@ services:
|
||||||
ports:
|
ports:
|
||||||
- 5001:5001
|
- 5001:5001
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/app/data
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
- ./data:/app/data
|
||||||
|
- /opt/stacks:/opt/stacks
|
||||||
|
environment:
|
||||||
|
- DOCKGE_STACKS_DIR=/opt/stacks
|
||||||
|
|
|
@ -1,11 +1,20 @@
|
||||||
|
############################################
|
||||||
|
# Build
|
||||||
|
############################################
|
||||||
|
FROM louislam/dockge:base AS build
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --chown=node:node ./package.json ./package.json
|
||||||
|
COPY --chown=node:node ./pnpm-lock.yaml ./pnpm-lock.yaml
|
||||||
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
|
||||||
|
|
||||||
############################################
|
############################################
|
||||||
# ⭐ Main Image
|
# ⭐ Main Image
|
||||||
############################################
|
############################################
|
||||||
FROM louislam/dockge:base AS release
|
FROM louislam/dockge:base AS release
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --chown=node:node . .
|
COPY --chown=node:node . .
|
||||||
RUN pnpm install --prod --frozen-lockfile && \
|
COPY --from=build /app/node_modules /app/node_modules
|
||||||
mkdir ./data
|
RUN mkdir ./data
|
||||||
|
|
||||||
VOLUME /app/data
|
VOLUME /app/data
|
||||||
EXPOSE 5001
|
EXPOSE 5001
|
||||||
|
|
|
@ -194,7 +194,7 @@ const template = `version: "3.8"
|
||||||
services:
|
services:
|
||||||
nginx:
|
nginx:
|
||||||
image: nginx:latest
|
image: nginx:latest
|
||||||
restart: always
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- "8080:80"
|
- "8080:80"
|
||||||
`;
|
`;
|
||||||
|
@ -538,7 +538,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.jsonConfig.services[this.newContainerName] = {
|
this.jsonConfig.services[this.newContainerName] = {
|
||||||
restart: "always",
|
restart: "unless-stopped",
|
||||||
};
|
};
|
||||||
this.newContainerName = "";
|
this.newContainerName = "";
|
||||||
let element = this.$refs.containerList.lastElementChild;
|
let element = this.$refs.containerList.lastElementChild;
|
||||||
|
|
15
package.json
15
package.json
|
@ -42,15 +42,12 @@
|
||||||
"type-fest": "~4.3.3",
|
"type-fest": "~4.3.3",
|
||||||
"yaml": "~2.3.4"
|
"yaml": "~2.3.4"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
|
||||||
"pm2": "~5.3.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@fortawesome/fontawesome-svg-core": "6.4.2",
|
"@fortawesome/fontawesome-svg-core": "6.4.2",
|
||||||
"@fortawesome/free-regular-svg-icons": "6.4.2",
|
"@fortawesome/free-regular-svg-icons": "6.4.2",
|
||||||
"@fortawesome/free-solid-svg-icons": "6.4.2",
|
"@fortawesome/free-solid-svg-icons": "6.4.2",
|
||||||
"@fortawesome/vue-fontawesome": "3.0.3",
|
"@fortawesome/vue-fontawesome": "3.0.3",
|
||||||
"@types/bootstrap": "^5.2.8",
|
"@types/bootstrap": "~5.2.8",
|
||||||
"@types/command-exists": "~1.2.3",
|
"@types/command-exists": "~1.2.3",
|
||||||
"@types/express": "~4.17.21",
|
"@types/express": "~4.17.21",
|
||||||
"@types/jsonwebtoken": "~9.0.4",
|
"@types/jsonwebtoken": "~9.0.4",
|
||||||
|
@ -63,19 +60,17 @@
|
||||||
"eslint": "~8.50.0",
|
"eslint": "~8.50.0",
|
||||||
"eslint-plugin-jsdoc": "~46.8.2",
|
"eslint-plugin-jsdoc": "~46.8.2",
|
||||||
"eslint-plugin-vue": "~9.17.0",
|
"eslint-plugin-vue": "~9.17.0",
|
||||||
"monaco-editor": "^0.44.0",
|
|
||||||
"monaco-yaml": "^5.1.0",
|
|
||||||
"prismjs": "~1.29.0",
|
"prismjs": "~1.29.0",
|
||||||
"sass": "~1.68.0",
|
"sass": "~1.68.0",
|
||||||
"typescript": "~5.2.2",
|
"typescript": "~5.2.2",
|
||||||
"unplugin-vue-components": "^0.25.2",
|
"unplugin-vue-components": "~0.25.2",
|
||||||
"vite": "~4.5.0",
|
"vite": "~4.5.0",
|
||||||
"vite-plugin-compression": "^0.5.1",
|
"vite-plugin-compression": "~0.5.1",
|
||||||
"vue": "~3.3.8",
|
"vue": "~3.3.8",
|
||||||
"vue-eslint-parser": "^9.3.2",
|
"vue-eslint-parser": "~9.3.2",
|
||||||
"vue-i18n": "~9.5.0",
|
"vue-i18n": "~9.5.0",
|
||||||
"vue-prism-editor": "2.0.0-alpha.2",
|
"vue-prism-editor": "2.0.0-alpha.2",
|
||||||
"vue-qrcode": "^2.2.0",
|
"vue-qrcode": "~2.2.0",
|
||||||
"vue-router": "~4.2.5",
|
"vue-router": "~4.2.5",
|
||||||
"vue-toastification": "2.0.0-rc.5",
|
"vue-toastification": "2.0.0-rc.5",
|
||||||
"xterm": "~5.3.0",
|
"xterm": "~5.3.0",
|
||||||
|
|
1005
pnpm-lock.yaml
1005
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue