0.4.3 • Published 9 months ago

js-dockerfile v0.4.3

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

js-dockerfile

js-dockerfile is a package for creating Dockerfiles in JavaScript.

Usage

First, install js-dockerfile using your preferred package manager:

npm install js-dockerfile

Then, import it and use it in your project like the following example:

import fs from 'node:fs'

import { Dockerfile } from 'js-dockerfile'

const d = Dockerfile.create()
const nodeVersion = 16
d.FROM(`node:${nodeVersion} AS base`)
d.RUN('apt-get update')
d.RUN('apt-get install openssl')
d.FROM('base AS dependencies')
d.RUN('npm set progress=false && npm config set depth 0')
d.RUN('npm install --omit=dev')
d.FROM('base AS release')
d.COPY('/node_modules', './node_modules', { from: 'dependencies' })
d.EXPOSE('$PRISMA_STUDIO_PORT')
d.ENTRYPOINT(["npx", "prisma", "studio"])

fs.writeFileSync('Dockerfile', d.toString())
0.4.1

9 months ago

0.4.0

9 months ago

0.4.3

9 months ago

0.4.2

9 months ago

0.3.5

12 months ago

0.3.1

1 year ago

0.3.4

1 year ago

0.1.1

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago