Honestly way too much went into this single commit. I am so sorry future me

This commit is contained in:
Emma
2023-06-09 00:54:00 -06:00
parent cd3f653f3f
commit 42c0004150
67 changed files with 4617 additions and 92 deletions

View File

@@ -1,3 +1,5 @@
import {parse, stringify} from 'yaml';
for await (const service of Deno.readDir('.')) {
if (service.isFile || !service.name.includes('-service')) continue;
@@ -11,7 +13,7 @@ ${port ? 'EXPOSE ' + port : ''}
WORKDIR /${serviceName}
ADD ./user-service .
ADD ${serviceFile} .
COPY ./deno.jsonc .
COPY ./secrets.json .
COPY ./key.txt .
@@ -19,6 +21,16 @@ ADD ./common ./common
ADD ./lib ./lib
ADD ./middleware ./middleware
CMD ["run", "${perms.join('", "')}", main.ts${port ? `, "${port}"` : ''}]
CMD ["run", "${perms.join('", "')}", "main.ts"${port ? `, "${port}"` : ''}]
`);
const dockerCompose: any = parse(await Deno.readTextFile('./docker-compose.yml'));
dockerCompose['services'][serviceName] = {
build: {
context: "./",
dockerfile: serviceFile + 'Dockerfile'
}
}
await Deno.writeTextFile('./docker-compose.yml', stringify(dockerCompose))
}