From f70364c8b5b436cb6abb448089ba24a3c255402d Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Tue, 24 Dec 2024 11:17:16 -0500 Subject: [PATCH] support prisma remix example --- gdf.js | 2 ++ test/base/windows/Dockerfile | 2 +- test/base/windows/docker-entrypoint.js | 2 +- test/frameworks/remix-indie/Dockerfile | 2 +- test/frameworks/remix-indie/docker-entrypoint.js | 2 +- test/frameworks/remix-pnpm/Dockerfile | 2 +- 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gdf.js b/gdf.js index 3dd7ba9..040492c 100755 --- a/gdf.js +++ b/gdf.js @@ -803,6 +803,8 @@ export class GDF { return [this.npx, 'foreman', 'start', '--procfile', 'Procfile.prod'] } else if (this.standaloneNextjs) { return ['node', 'server.js'] + } else if (this.remix && this.#pj.scripts?.start === 'remix-serve build') { + return [this.npx, 'remix-serve', './build/index.js'] } if (this.options.distroless) { diff --git a/test/base/windows/Dockerfile b/test/base/windows/Dockerfile index 8385151..997f123 100644 --- a/test/base/windows/Dockerfile +++ b/test/base/windows/Dockerfile @@ -63,4 +63,4 @@ ENTRYPOINT [ "/app/docker-entrypoint.js" ] # Start the server by default, this can be overwritten at runtime EXPOSE 3000 ENV DATABASE_URL="file:///data/sqlite.db" -CMD [ "npm", "run", "start" ] +CMD [ "npx", "remix-serve", "./build/index.js" ] diff --git a/test/base/windows/docker-entrypoint.js b/test/base/windows/docker-entrypoint.js index 2251f09..4c21838 100755 --- a/test/base/windows/docker-entrypoint.js +++ b/test/base/windows/docker-entrypoint.js @@ -6,7 +6,7 @@ const env = { ...process.env } ;(async() => { // If running the web server then migrate existing database - if (process.argv.slice(2).join(' ') === 'npm run start') { + if (process.argv.slice(2).join(' ') === 'npx remix-serve ./build/index.js') { await exec('npx prisma migrate deploy') } diff --git a/test/frameworks/remix-indie/Dockerfile b/test/frameworks/remix-indie/Dockerfile index fe75f4c..e3560e5 100644 --- a/test/frameworks/remix-indie/Dockerfile +++ b/test/frameworks/remix-indie/Dockerfile @@ -59,4 +59,4 @@ ENTRYPOINT [ "/app/docker-entrypoint.js" ] # Start the server by default, this can be overwritten at runtime EXPOSE 3000 ENV DATABASE_URL="file:///data/sqlite.db" -CMD [ "npm", "run", "start" ] +CMD [ "npx", "remix-serve", "./build/index.js" ] diff --git a/test/frameworks/remix-indie/docker-entrypoint.js b/test/frameworks/remix-indie/docker-entrypoint.js index 2251f09..4c21838 100755 --- a/test/frameworks/remix-indie/docker-entrypoint.js +++ b/test/frameworks/remix-indie/docker-entrypoint.js @@ -6,7 +6,7 @@ const env = { ...process.env } ;(async() => { // If running the web server then migrate existing database - if (process.argv.slice(2).join(' ') === 'npm run start') { + if (process.argv.slice(2).join(' ') === 'npx remix-serve ./build/index.js') { await exec('npx prisma migrate deploy') } diff --git a/test/frameworks/remix-pnpm/Dockerfile b/test/frameworks/remix-pnpm/Dockerfile index 1b26cbb..ee124ad 100644 --- a/test/frameworks/remix-pnpm/Dockerfile +++ b/test/frameworks/remix-pnpm/Dockerfile @@ -46,4 +46,4 @@ COPY --from=build /app /app # Start the server by default, this can be overwritten at runtime EXPOSE 3000 -CMD [ "pnpm", "run", "start" ] +CMD [ "npx", "remix-serve", "./build/index.js" ]