New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@flydotio/dockerfile

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flydotio/dockerfile - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

templates/test

42

fly.js

@@ -24,5 +24,8 @@ import crypto from 'node:crypto'

// set secrets for AdonisJS apps
if (this.adonisjs) this.flyAdonisJsSecrets(this.flyApp)
// set up for deploy
if (fs.existsSync('.github/workflows/deploy.yml')) {
this.flyGithubPrep()
this.flyGitHubPrep()
}

@@ -154,4 +157,4 @@ }

// set various secrets for Remix (and Epic Stack) applications
flyRemixSecrets(app) {
// set various secrets
flySetSecrets({ app, requiredSecrets, shouldSet = () => true }) {
let secrets = this.flySecrets

@@ -170,12 +173,6 @@

const required = [
'SESSION_SECRET',
'ENCRYPTION_SECRET',
'INTERNAL_COMMAND_TOKEN'
]
for (const name of requiredSecrets) {
if (!secrets || secrets.includes(name)) continue
if (!shouldSet(name)) continue
for (const name of required) {
if (secrets.includes(name)) return
if (name !== 'SESSION_SECRET' && !this.epicStack) continue
const value = crypto.randomBytes(32).toString('hex')

@@ -191,4 +188,21 @@

// prep for deployment via github actions, inclusing settting up a staging app
flyGithubPrep() {
// set various secrets for Remix (and Epic Stack) applications
flyRemixSecrets(app) {
this.flySetSecrets({
app,
requiredSecrets: ['SESSION_SECRET', 'INTERNAL_COMMAND_TOKEN'],
shouldSet: (name) => name === 'SESSION_SECRET' || this.epicStack
})
}
// set various secrets for AdonisJS applications
flyAdonisJsSecrets(app) {
this.flySetSecrets({
app,
requiredSecrets: ['APP_KEY']
})
}
// prep for deployment via GitHub actions, including setting up a staging app
flyGitHubPrep() {
const deploy = fs.readFileSync('.github/workflows/deploy.yml', 'utf-8')

@@ -195,0 +209,0 @@

@@ -88,2 +88,21 @@ import fs from 'node:fs'

// Does this application use adonisjs?
get adonisjs() {
return !!this.#pj.dependencies?.['@adonisjs/core']
}
get adonisjsFileUpload() {
if (!fs.existsSync(path.join(this._appdir, 'config/drive.ts'))) {
return false
}
const driveConfig = fs.readFileSync(path.join(this._appdir, 'config/drive.ts'), 'utf8')
return driveConfig.includes("Application.tmpPath('uploads')")
}
// Does this application use postgres?
get postgres() {
return this.adonisjs && !!this.#pj.dependencies?.pg
}
// Does this application use nest?

@@ -96,2 +115,10 @@ get nestjs() {

get sqlite3() {
if (this.prisma) {
try {
const schema = fs.readFileSync(path.join(this._appdir, 'prisma/schema.prisma'), 'utf-8')
if (/^\s*provider\s*=\s*"sqlite"/m.test(schema)) return true
} catch {
}
}
return !!this.#pj.dependencies?.sqlite3 ||

@@ -114,2 +141,3 @@ !!this.#pj.dependencies?.['better-sqlite3'] ||

if (this.remix && this.sqlite3) packages.push('sqlite3')
if (this.prisma) packages.push('openssl')

@@ -126,2 +154,13 @@ return packages.sort()

// what bun version should be used?
get bunVersion() {
if (this.#packager !== 'bun') return
try {
return execSync('bun --version', { encoding: 'utf8' })
.match(/\d+\.\d+\.\d+/)?.[0]
} catch {
}
}
// classic version of yarn (installed by default)

@@ -173,3 +212,4 @@ yarnClassic = '1.22.19'

'pnpm-lock.yaml',
'yarn.lock', '.yarnrc'
'yarn.lock', '.yarnrc',
'bun.lockb'
]

@@ -192,6 +232,8 @@

if (packageFiles.includes('yarn.lock')) {
this.#packager = 'yarn'
if (packageFiles.includes('bun.lockb')) {
this.#packager = 'bun'
} else if (packageFiles.includes('pnpm-lock.yaml')) {
this.#packager = 'pnpm'
} else if (packageFiles.includes('yarn.lock')) {
this.#packager = 'yarn'
} else {

@@ -227,6 +269,8 @@ this.#packager = 'npm'

// optionally include dev dependencies
if (this.devDependencies && !this.pnpm) {
if (this.devDependencies) {
if (this.yarn) {
install += ' --production=false'
} else {
} else if (this.pnpm) {
install += ' --prod=false'
} else if (!this.bunVersion) {
install += ' --include=dev'

@@ -265,2 +309,4 @@ }

prune = 'pnpm prune --prod'
} else if (this.bunVersion) {
prune = 'rm -rf node_modules && \\\n bun install --production'
} else {

@@ -309,7 +355,9 @@ prune = 'npm prune --omit=dev'

if (this.bunVersion) runtime = 'Bun'
if (this.remix) runtime = 'Remix'
if (this.nextjs) runtime = 'Next.js'
if (this.nuxtjs) runtime = 'Nuxt.js'
if (this.nuxtjs) runtime = 'Nuxt'
if (this.nestjs) runtime = 'NestJS'
if (this.gatsby) runtime = 'Gatsby'
if (this.adonisjs) runtime = 'AdonisJS'

@@ -333,2 +381,6 @@ if (this.prisma) runtime += '/Prisma'

if (this.adonisjs) {
return ['node', '/app/build/server.js']
}
if (this.gatsby) {

@@ -352,3 +404,3 @@ return ['npx', 'gatsby', 'serve', '-H', '0.0.0.0']

get entrypoint() {
return this.prisma || this.options.swap
return this.prisma || this.options.swap || this.adonisjs
}

@@ -361,3 +413,3 @@

const entrypoint = path.join(this._appdir, 'docker-entrypoint')
const entrypoint = path.join(this._appdir, 'docker-entrypoint.js')

@@ -368,7 +420,7 @@ const stat = fs.statSync(entrypoint, { throwIfNoEntry: false })

if (this.options.windows || !(stat.mode & fs.constants.S_IXUSR)) {
fixups.push('chmod +x ./docker-entrypoint')
fixups.push('chmod +x ./docker-entrypoint.js')
}
if (this.options.windows || fs.readFileSync(entrypoint, 'utf-8').includes('\r')) {
fixups.push('sed -i "s/\\r$//g" ./docker-entrypoint')
fixups.push('sed -i "s/\\r$//g" ./docker-entrypoint.js')
}

@@ -381,3 +433,4 @@

get usingTabs() {
return this.remix
// disable for now as remix isn't using this generator and it conflicts with eslint
return false // this.remix
}

@@ -384,0 +437,0 @@

{
"name": "@flydotio/dockerfile",
"version": "0.3.0",
"version": "0.3.1",
"description": "Dockerfile generator",

@@ -5,0 +5,0 @@ "main": "./index.js",

@@ -20,2 +20,3 @@ ## Overview

```
bun add -d @flydotio/dockerfile
npm install @flydotio/dockerfile --save-dev

@@ -26,8 +27,4 @@ pnpm add -D @flydotio/dockerfile

Once installed, you can run and re-run using:
Once installed, you can run and re-run using `npx dockerfile` for Node.js applications or `bunx dockerfile` for Bun applications.
```
npx dockerfile
```
Options are saved between runs into `package.json`. To invert a boolean options, add or remove a no- prefix from the option name.

@@ -34,0 +31,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc