mirror of
https://github.com/ershisan99/coolify.git
synced 2026-01-23 05:12:03 +00:00
feat: Service secrets
This commit is contained in:
@@ -3,7 +3,7 @@ import * as db from '$lib/database';
|
||||
import { promises as fs } from 'fs';
|
||||
import yaml from 'js-yaml';
|
||||
import type { RequestHandler } from '@sveltejs/kit';
|
||||
import { ErrorHandler } from '$lib/database';
|
||||
import { ErrorHandler, getServiceImage } from '$lib/database';
|
||||
import { makeLabelForServices } from '$lib/buildPacks/common';
|
||||
|
||||
export const post: RequestHandler = async (event) => {
|
||||
@@ -19,6 +19,7 @@ export const post: RequestHandler = async (event) => {
|
||||
version,
|
||||
destinationDockerId,
|
||||
destinationDocker,
|
||||
serviceSecret,
|
||||
vscodeserver: { password }
|
||||
} = service;
|
||||
|
||||
@@ -26,13 +27,20 @@ export const post: RequestHandler = async (event) => {
|
||||
const host = getEngine(destinationDocker.engine);
|
||||
|
||||
const { workdir } = await createDirectories({ repository: type, buildId: id });
|
||||
const image = getServiceImage(type);
|
||||
|
||||
const config = {
|
||||
image: `codercom/code-server:${version}`,
|
||||
image: `${image}:${version}`,
|
||||
volume: `${id}-vscodeserver-data:/home/coder`,
|
||||
environmentVariables: {
|
||||
PASSWORD: password
|
||||
}
|
||||
};
|
||||
if (serviceSecret.length > 0) {
|
||||
serviceSecret.forEach((secret) => {
|
||||
config.environmentVariables[secret.name] = secret.value;
|
||||
});
|
||||
}
|
||||
const composeFile = {
|
||||
version: '3.8',
|
||||
services: {
|
||||
|
||||
Reference in New Issue
Block a user