All Projects → denoland → deno_docker

denoland / deno_docker

Licence: MIT license
Latest dockerfiles and images for Deno - alpine, centos, debian, ubuntu

Programming Languages

Dockerfile
14818 projects
typescript
32286 projects
shell
77523 projects

Projects that are alternatives of or similar to deno docker

coreutils
🦕 Cross-platform Deno rewrite of the GNU Coreutils
Stars: ✭ 22 (-96.76%)
Mutual labels:  deno
cache
🥌 Deno cache library
Stars: ✭ 38 (-94.4%)
Mutual labels:  deno
marky
A modular and extensible ESM and Deno Markdown parser.
Stars: ✭ 16 (-97.64%)
Mutual labels:  deno
denobyexample
Deno by example - short examples showcasing how to use Deno
Stars: ✭ 72 (-89.38%)
Mutual labels:  deno
wocket
A WebSocket library for Deno
Stars: ✭ 103 (-84.81%)
Mutual labels:  deno
wasm
fast wasm modules
Stars: ✭ 37 (-94.54%)
Mutual labels:  deno
rhum
A test double library
Stars: ✭ 92 (-86.43%)
Mutual labels:  deno
sirdez
Glorious Binary Serialization and Deserialization for TypeScript.
Stars: ✭ 20 (-97.05%)
Mutual labels:  deno
depsbot
⚙️ GitHub action to check freshness of your deno dependencies
Stars: ✭ 28 (-95.87%)
Mutual labels:  deno
crux.land
crux.land is a free registry service meant for hosting small (≤ 20kB) single deno scripts.
Stars: ✭ 50 (-92.63%)
Mutual labels:  deno
publish
Publish your module with one command in Deno.
Stars: ✭ 16 (-97.64%)
Mutual labels:  deno
lisan
🌈i18n, Reimagined! 🚀A blazing fast and super small i18n library for Javascript
Stars: ✭ 85 (-87.46%)
Mutual labels:  deno
monkey-master
A deno tool for buying hot GPUs in JD, such as RTX3080 rx6800, a thick-skinned orange!
Stars: ✭ 180 (-73.45%)
Mutual labels:  deno
svelte-adapter-deno
A SvelteKit adapter for Deno
Stars: ✭ 152 (-77.58%)
Mutual labels:  deno
dps-dial.vim
Increment/decrement plugin using denops.vim
Stars: ✭ 21 (-96.9%)
Mutual labels:  deno
exodus.ts
The first MongoDB compatible data migration tool built on for the Deno runtime environment, allowing users to perform complete schema and database migrations.
Stars: ✭ 42 (-93.81%)
Mutual labels:  deno
postgres-deno
A PostgreSQL extension for Deno: run Typescript in PostgreSQL functions and triggers.
Stars: ✭ 87 (-87.17%)
Mutual labels:  deno
Ogone
Advanced Web Composition for Future
Stars: ✭ 38 (-94.4%)
Mutual labels:  deno
deno doc
Documentation generator for Deno
Stars: ✭ 162 (-76.11%)
Mutual labels:  deno
create-xc-app
⚡️ Create a project in seconds!
Stars: ✭ 15 (-97.79%)
Mutual labels:  deno

deno_docker

Docker files for Deno published on Dockerhub:

ci status


Run locally

To start the deno repl:

$ docker run -it denoland/deno:1.24.0 repl

To shell into the docker runtime:

$ docker run -it denoland/deno:1.24.0 sh

To run main.ts from your working directory:

$ docker run -it -p 1993:1993 -v $PWD:/app denoland/deno:1.24.0 run --allow-net /app/main.ts

Here, -p 1993:1993 maps port 1993 on the container to 1993 on the host, -v $PWD:/app mounts the host working directory to /app on the container, and --allow-net /app/main.ts is passed to deno on the container.

As a Dockerfile

FROM denoland/deno:1.24.0

# The port that your application listens to.
EXPOSE 1993

WORKDIR /app

# Prefer not to run as root.
USER deno

# Cache the dependencies as a layer (the following two steps are re-run only when deps.ts is modified).
# Ideally cache deps.ts will download and compile _all_ external files used in main.ts.
COPY deps.ts .
RUN deno cache deps.ts

# These steps will be re-run upon each file change in your working directory:
ADD . .
# Compile the main app so that it doesn't need to be compiled each startup/entry.
RUN deno cache main.ts

CMD ["run", "--allow-net", "main.ts"]

and build and run this locally:

$ docker build -t app . && docker run -it -p 1993:1993 app

Using your own base image

If you prefer to install deno in your own base image, you can use the denoland/deno:bin to simplify the process.

ARG DENO_VERSION=1.24.0

FROM denoland/deno:bin-$DENO_VERSION AS deno
FROM ubuntu
COPY --from=deno /deno /usr/local/bin/deno

(optional) Add deno alias to your shell

Alternatively, you can add deno command to your shell init file (e.g. .bashrc):

deno () {
  docker run \
    --interactive \
    --tty \
    --rm \
    --volume $PWD:/app \
    --volume $HOME/.deno:/deno-dir \
    --workdir /app \
    denoland/deno:1.24.0 \
    "$@"
}

and in your terminal

$ source ~/.bashrc
$ deno --version
$ deno run ./main.ts

See example directory.

Note: Dockerfiles provide a USER deno and DENO_DIR is set to /deno-dir/ (which can be overridden).

If running multiple Deno instances within the same image you can mount this directory as a shared volume.

Thanks

Thanks to Andy Hayden for maintaining and setting up these images.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].