diff --git a/fly.js b/fly.js index 153d87f..5eaa0d9 100755 --- a/fly.js +++ b/fly.js @@ -25,9 +25,10 @@ GDF.extend(class extends GDF { if (this.remix) { this.flyRemixSecrets(this.flyApp) this.flyHealthCheck('/healthcheck') - if (this.postgres) this.flyRelease(`${this.npx} prisma migrate deploy`) } + if (this.prisma && this.postgres) this.flyRelease(`${this.npx} prisma migrate deploy`) + // set secrets for AdonisJS apps if (this.adonisjs) this.flyAdonisJsSecrets(this.flyApp) @@ -240,7 +241,11 @@ GDF.extend(class extends GDF { flyRelease(command) { if (this.flyToml.includes('[deploy]')) return - this.flyToml += `\n[deploy]\n release_command = ${JSON.stringify(command)}` + this.flyToml += `\n[deploy]\n release_command = ${JSON.stringify(command)}\n` + + if (this.prismaSeed) { + this.flyToml += ' seed_command = "npx prisma db seed"\n' + } fs.writeFileSync(this.flyTomlFile, this.flyToml) } diff --git a/templates/Dockerfile.ejs b/templates/Dockerfile.ejs index 3f732be..44ba526 100644 --- a/templates/Dockerfile.ejs +++ b/templates/Dockerfile.ejs @@ -178,7 +178,7 @@ COPY --from=build /app/dist /app/dist ENV PORT=4321 ENV HOST=0.0.0.0 -<% } else if (svelte && !entrypoint) { -%> +<% } else if (svelte && !prisma) { -%> COPY --from=build /app/build /app/build COPY --from=build /app/node_modules /app/node_modules COPY --from=build /app/package.json /app diff --git a/test/frameworks/remix-blues/fly.toml b/test/frameworks/remix-blues/fly.toml index ed0f4ed..c8d481d 100644 --- a/test/frameworks/remix-blues/fly.toml +++ b/test/frameworks/remix-blues/fly.toml @@ -9,4 +9,5 @@ swap_size_mb = 512 path = "/healthcheck" [deploy] - release_command = "npx prisma migrate deploy" \ No newline at end of file + release_command = "npx prisma migrate deploy" + seed_command = "npx prisma db seed"