fix: volume name

This commit is contained in:
Andras Bacsai 2022-03-02 12:17:48 +01:00
parent acacef95cd
commit c084b22815

View File

@ -38,11 +38,18 @@ export const post: RequestHandler = async (event) => {
}
},
volumes: {
[`${id}-ngrams`]: {}
[`${id}-ngrams`]: {
external: true
}
}
};
const composeFileDestination = `${workdir}/docker-compose.yaml`;
await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
try {
await asyncExecShell(`DOCKER_HOST=${host} docker volume create ${id}-ngrams`);
} catch (error) {
console.log(error);
}
try {
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);