From 908654bcd09625721e0c1b81ea598d375a50f1bc Mon Sep 17 00:00:00 2001 From: Jason Date: Sun, 10 Jul 2022 10:05:19 -0400 Subject: [PATCH] =?UTF-8?q?=20=F0=9F=A6=88=F0=9F=8F=A0=F0=9F=90=9C?= =?UTF-8?q?=E2=9D=97=20Initial=20Commit=20=E2=9D=97=F0=9F=90=9C?= =?UTF-8?q?=F0=9F=A6=88=F0=9F=8F=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 90 ++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 40 +++++++++++++++++++ LICENSE.md | 13 ++++++ README.md | 47 ++++++++++++++++++++++ bin/entrypoint-deno.sh | 77 ++++++++++++++++++++++++++++++++++++ 5 files changed, 267 insertions(+) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 LICENSE.md create mode 100644 README.md create mode 100755 bin/entrypoint-deno.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e72f8cd --- /dev/null +++ b/.gitignore @@ -0,0 +1,90 @@ +# gitignore created on 07/10/22 at 10:05 +# Disable reminder in prompt +ignoredirmessage + +# OS generated files +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# Other +**/.installed + +# ignore commit message +**/.gitcommit + +#ignore .failed +**/.build_failed + +# ignore .bak files +**/*.bak + +# ignore .no_push files +**/.no_push + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1b12560 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,40 @@ +FROM casjaysdevdocker/alpine:latest as build + +RUN apk --no-cache add --update + +COPY ./bin/. /usr/local/bin/ +COPY ./config/. /config/ +COPY ./data/. /data/ + +FROM scratch + +ARG BUILD_DATE="$(date +'%Y-%m-%d %H:%M')" + +LABEL org.label-schema.name="deno" \ + org.label-schema.description="containerized version of deno" \ + org.label-schema.url="https://github.com/casjaysdevdocker/deno/deno" \ + org.label-schema.vcs-url="https://github.com/casjaysdevdocker/deno/deno" \ + org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.version=$BUILD_DATE \ + org.label-schema.vcs-ref=$BUILD_DATE \ + org.label-schema.license="WTFPL" \ + org.label-schema.vcs-type="Git" \ + org.label-schema.schema-version="latest" \ + org.label-schema.vendor="CasjaysDev" \ + maintainer="CasjaysDev " + +ENV SHELL="/bin/bash" \ + TERM="xterm-256color" \ + HOSTNAME="casjaysdev-deno" \ + TZ="${TZ:-America/New_York}" + +WORKDIR /root +VOLUME ["/root","/config"] +EXPOSE 9090 + +COPY --from=build /. / + +HEALTHCHECK CMD [ "/usr/local/bin/entrypoint-deno.sh", "healthcheck" ] +ENTRYPOINT [ "/usr/local/bin/entrypoint-deno.sh" ] +CMD [ "/usr/bin/bash", "-l" ] + diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..86d4345 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,13 @@ + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2022 Jason Hempstead + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 1. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/README.md b/README.md new file mode 100644 index 0000000..20483b3 --- /dev/null +++ b/README.md @@ -0,0 +1,47 @@ +# 👋 deno Readme 👋 + + + +## Run container + +```shell +dockermgr install deno +``` + +### via command line + +```shell +docker run -d \ +--restart always \ +--name deno \ +--hostname casjaysdev-deno \ +-e TZ=${TIMEZONE:-America/New_York} \ +-v $PWD/deno/data:/data \ +-v $PWD/deno/config:/config \ +-p 80:80 \ +casjaysdev/deno:latest +``` + +### via docker-compose + +```yaml +version: "2" +services: + deno: + image: casjaysdev/deno + container_name: deno + environment: + - TZ=America/New_York + - HOSTNAME=casjaysdev-deno + volumes: + - $HOME/.local/share/docker/storage/deno/data:/data + - $HOME/.local/share/docker/storage/deno/config:/config + ports: + - 80:80 + restart: always +``` + +## Authors + +🤖 Jason Hempstead: [Github](https://github.com/Jason Hempstead) [Docker](https://hub.docker.com/Jason Hempstead) 🤖 +⛵ CasjaysDev: [Github](https://github.com/casjaysdev) [Docker](https://hub.docker.com/casjaysdev) ⛵ diff --git a/bin/entrypoint-deno.sh b/bin/entrypoint-deno.sh new file mode 100755 index 0000000..031ca8e --- /dev/null +++ b/bin/entrypoint-deno.sh @@ -0,0 +1,77 @@ +#!/usr/bin/env bash +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +##@Version : 202207101005-git +# @Author : Jason Hempstead +# @Contact : jason@casjaysdev.com +# @License : WTFPL +# @ReadME : entrypoint-deno.sh --help +# @Copyright : Copyright: (c) 2022 Jason Hempstead, Casjays Developments +# @Created : Sunday, Jul 10, 2022 10:05 EDT +# @File : entrypoint-deno.sh +# @Description : +# @TODO : +# @Other : +# @Resource : +# @sudo/root : no +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +APPNAME="$(basename "$0" 2>/dev/null)" +VERSION="202207101005-git" +HOME="${USER_HOME:-$HOME}" +USER="${SUDO_USER:-$USER}" +RUN_USER="${SUDO_USER:-$USER}" +SRC_DIR="${BASH_SOURCE%/*}" +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Set bash options +if [[ "$1" == "--debug" ]]; then shift 1 && set -xo pipefail && export SCRIPT_OPTS="--debug" && export _DEBUG="on"; fi +trap 'exitCode=${exitCode:-$?}' EXIT + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -' +__exec_bash() { [ $# -ne 0 ] && exec "${*:-bash -l}" || exec /bin/bash -l; } +__find() { ls -A "$*" 2>/dev/null; } +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +DATA_DIR="$(__find /data/ 2>/dev/null | grep '^' || false)" +CONFIG_DIR="$(__find /config/ 2>/dev/null | grep '^' || false)" +export TZ="${TZ:-America/New_York}" +export HOSTNAME="${HOSTNAME:-casjaysdev-bin}" +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +if [[ -n "${TZ}" ]]; then + echo "${TZ}" >/etc/timezone +fi +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +if [[ -f "/usr/share/zoneinfo/${TZ}" ]]; then + ln -sf "/usr/share/zoneinfo/${TZ}" "/etc/localtime" +fi +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +if [[ -n "${HOSTNAME}" ]]; then + echo "${HOSTNAME}" >/etc/hostname + echo "127.0.0.1 $HOSTNAME localhost" >/etc/hosts +fi +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +if [[ -n "$CONFIG_DIR" ]] && [[ -d "$CONFIG_DIR" ]]; then + for config in $CONFIG_DIR; do + if [[ -d "/config/$config" ]]; then + cp -Rf "/config/$config/." "/etc/$config/" + elif [[ -f "/config/$config" ]]; then + cp -Rf "/config/$config" "/etc/$config" + fi + done +fi +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +case "$1" in +--help) + echo "Usage: $APPNAME [healthcheck, bash, command]" + exit + ;; +healthcheck) + echo 'OK' + ;; +bash | shell | sh) + shift 1 + __exec_bash "$@" + ;; +*) + __exec_bash "$@" + ;; +esac +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +#end