@flydotio/dockerfile
Advanced tools
Comparing version 0.4.1 to 0.4.2
17
gdf.js
@@ -14,3 +14,5 @@ import fs from 'node:fs' | ||
export const defaults = { | ||
cmd: '', | ||
dev: false, | ||
entrypoint: '', | ||
distroless: false, | ||
@@ -496,2 +498,4 @@ ignoreScripts: false, | ||
get startCommand() { | ||
if (this.options.cmd) return JSON.stringify(this.options.cmd) | ||
if (this.options.distroless) { | ||
@@ -531,7 +535,14 @@ const start = this.#pj.scripts.start | ||
// Does this Dockerfile need an entrypoint script? | ||
// Entrypoint script | ||
get entrypoint() { | ||
return (this.prisma && this.sqlite3) || | ||
if (this.options.entrypoint) return JSON.stringify(this.options.entrypoint) | ||
if (!((this.prisma && this.sqlite3) || | ||
(this.options.swap && !this.flySetup()) || | ||
this.adonisjs | ||
this.adonisjs)) return null | ||
const entrypoint = [`/app/${this.configDir}docker-entrypoint.js`] | ||
if (this.litefs) entrypoint.unshift('litefs', 'mount', '--') | ||
return JSON.stringify(entrypoint, null, 1).replace(/\n\s*/g, ' ') | ||
} | ||
@@ -538,0 +549,0 @@ |
@@ -23,2 +23,6 @@ #!/usr/bin/env node | ||
.epilog('Options are saved between runs into package.json. more info:\n https://github.com/fly-apps/dockerfile-node#readme') | ||
.option('cmd', { | ||
describe: 'CMD to be used in the Dockerfile', | ||
type: 'string' | ||
}) | ||
.option('dev', { | ||
@@ -32,2 +36,6 @@ describe: 'install devDependencies in production', | ||
}) | ||
.option('entrypoint', { | ||
describe: 'ENTRYPOINT to be used in the Dockerfile', | ||
type: 'string' | ||
}) | ||
.option('force', { | ||
@@ -34,0 +42,0 @@ describe: 'force overwrite of existing files', |
{ | ||
"name": "@flydotio/dockerfile", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "Dockerfile generator", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
@@ -32,4 +32,6 @@ ## Overview | ||
* `--cmd` - CMD to use in Dockerfile | ||
* `--dev` - include `devDependencies` in the production image. | ||
* `--distroless` - use [distroless](https://github.com/GoogleContainerTools/distroless) base image to reduce image size | ||
* `--entrypoint` - ENTRYPOINT to use in Dockerfile | ||
* `--ignore-scripts` - do not execute any scripts defined in the project `package.json` and its dependencies. | ||
@@ -36,0 +38,0 @@ * `--force` - overwrite existing files |
Sorry, the diff of this file is not supported yet
53464
1095
92
11