mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
23 lines
508 B
TypeScript
23 lines
508 B
TypeScript
import { exec } from '../../helpers/utils/exec';
|
|
|
|
class DockerCompose {
|
|
private commandPrefix: string;
|
|
|
|
constructor(composeFiles: string[]) {
|
|
this.commandPrefix = 'docker-compose ' + composeFiles.map((f) => '-f ' + f).join(' ');
|
|
}
|
|
|
|
async up() {
|
|
await exec(this.commandPrefix + ' up -d');
|
|
}
|
|
|
|
async down() {
|
|
await exec(this.commandPrefix + ' down');
|
|
}
|
|
|
|
async restart(service: string) {
|
|
await exec(this.commandPrefix + ' restart ' + service);
|
|
}
|
|
}
|
|
|
|
export default DockerCompose; |