Honestly way too much went into this single commit. I am so sorry future me
This commit is contained in:
@@ -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))
|
||||
}
|
Reference in New Issue
Block a user