Skip to content

Instantly share code, notes, and snippets.

@osher
osher / node-service.multiphase.Dockerfile
Last active August 8, 2023 17:30
Example for the Dockerfile for node-services using an multi-phase build with optimized node-builder and node-runner.
ARG TAG_NODE_BUILDER=latest
FROM my-private-cr/node-builder:$TAG_NODE_BUILDER
COPY packge.json .
RUN npm i --production
ARG TAG_NODE_RUNNER=latest
FROM my-private-cr/node-runner:$TAG_NODE_RUNNER
COPY --from=0 /app /
COPY . /app/
RUN apk update --no-cache
@osher
osher / the.getting-started.improfessional.Dockerfile
Created May 8, 2023 14:58
the getting-started Dockerfile you get for nodejs docker images
FROM node:lts
WORKDIR /app
COPY . .
RUN npm i
EXPOSE 3000/tcp
CMD ["npm", "start"]
import * as requireYaml from "require-yml";
import * as set from "lodash.set";
import * as merge from "deepmerge";
import { load as parseYaml } from "js-yaml";
import { readFileSync } from "fs";
type StringMap = { [key: string]: string };
let config: any, configRootPath: string;
_resetConfig();