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 / sops-with-age-encryption.demo.sh
Last active November 18, 2023 19:54
The simplest sops demo - sops using age encryption
# This demo uses an alpine sandbox in a docker container in
# interactive mode. ran with:
# docker run --rm -it alpine
#
# if you run it on your own system:
# 1. you should use your own package manager instead of `apk`
# 2. expect the following left overs:
# - installed binaries (age, age-keygen, sops)
# - $HOME/.config/sops/age/keys.txt
# - demo files: source.env, encrypted.env, decrypted.env
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();