feat: use entrypoint to create user account and copy ssh key

This commit is contained in:
Justin Lin committed 2024-10-14 12:06:05 +08:00
1 parent 261c6fc029
commit be22a121c8
4 files changed
+26 -14

No files matched your search

+5 -2
View File
@@ -29,7 +29,10 @@ export function createContainer(
name: string,
imageId: string
): Promise<Docker.Container> {
let binds: string[] = []
let binds: string[] = [
`${config.projectRoot}/config/ssh_key.pub:/ssh_key.pub:ro`,
`${config.projectRoot}/quests/entrypoint.sh:/entrypoint.sh:ro`,
]
if (!config.isProduction && config.docker.mountQuest && imageId !== 'base') {
logger.info('Mounting quest folder', imageId)
binds = [
@@ -53,7 +56,7 @@ export async function getAndStartContainer(
await container.start()
}
await new Promise((resolve) => {
setTimeout(resolve, 1000)
setTimeout(resolve, 2000)
})
return container
}