Remove run.sh

This commit is contained in:
Ben Allfree 2023-12-18 07:54:28 -08:00
parent a1c5239607
commit ad2ddfc04e
2 changed files with 10 additions and 33 deletions

View File

@ -1,4 +1,4 @@
import { APEX_DOMAIN, PH_PROJECT_ROOT, mkInstanceDataPath } from '$constants' import { APEX_DOMAIN, mkInstanceDataPath } from '$constants'
import { InstanceLogger, PortService } from '$services' import { InstanceLogger, PortService } from '$services'
import { import {
LoggerService, LoggerService,
@ -12,7 +12,6 @@ import { map } from '@s-libs/micro-dash'
import Docker, { Container, ContainerCreateOptions } from 'dockerode' import Docker, { Container, ContainerCreateOptions } from 'dockerode'
import { existsSync } from 'fs' import { existsSync } from 'fs'
import MemoryStream from 'memorystream' import MemoryStream from 'memorystream'
import { join } from 'path'
import { AsyncReturnType } from 'type-fest' import { AsyncReturnType } from 'type-fest'
import { PocketbaseReleaseVersionService } from '../PocketbaseReleaseVersionService' import { PocketbaseReleaseVersionService } from '../PocketbaseReleaseVersionService'
import { buildImage } from './buildImage' import { buildImage } from './buildImage'
@ -108,25 +107,22 @@ export const createPocketbaseService = async (
}) })
} }
stderr.on('data', _stdErrData) stderr.on('data', _stdErrData)
const Binds = [`${mkInstanceDataPath(slug)}:/home/pocketbase`] const Binds = [
Binds.push(`${binPath}:/home/pocketbase/pocketbase:ro`) `${mkInstanceDataPath(slug)}:/home/pocketbase`,
Binds.push( `${binPath}:/home/pocketbase/pocketbase:ro`,
`${join( ]
PH_PROJECT_ROOT(),
'src',
'services',
'PocketBaseService',
`run.sh`,
)}:/home/pocketbase/run.sh:ro`,
)
if (extraBinds.length > 0) { if (extraBinds.length > 0) {
Binds.push(...extraBinds) Binds.push(...extraBinds)
} }
const Cmd = (() => {
return [`./pocketbase`, `serve`, `--http`, `0.0.0.0:8090`]
})()
const createOptions: ContainerCreateOptions = { const createOptions: ContainerCreateOptions = {
Image: INSTANCE_IMAGE_NAME, Image: INSTANCE_IMAGE_NAME,
Cmd: [`/bin/bash`, `./run.sh`], Cmd,
Env: map( Env: map(
{ {
...env, ...env,

View File

@ -1,19 +0,0 @@
#!/bim/bash
./pocketbase serve --http 0.0.0.0:8090 &
pid1=$!
# Start the second process in the background
# process2 &
# pid2=$!
# Wait for either process to exit
wait -n
exit_status=$?
# Kill the remaining process (if any)
kill $pid1 2>/dev/null
kill $pid2 2>/dev/null
# Exit with the captured exit status
exit $exit_status