From 789b9204cbc91dc99a08924e9d7044bb894fdf1c Mon Sep 17 00:00:00 2001 From: Julian Anderson Date: Thu, 13 Jun 2024 23:41:01 -0400 Subject: [PATCH 1/4] feat(docker): add Dockerfile and Compose spec Adds a basic Dockerfile and docker-compose.yml. Still needs work since we seemingly can't pass in the results of git describe --tags at start, but it's something. --- Dockerfile | 13 +++++++++++++ docker-compose.yml | 10 ++++++++++ 2 files changed, 23 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f15ef0a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM denoland/deno + +EXPOSE 8000 + +WORKDIR /app + +ADD . /app + +RUN deno cache server/main.ts + +ARG version +ENV DENO_DEPLOYMENT_ID $version +CMD deno run -A server/main.ts diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..6a5c092 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +services: + web: + build: + context: . + args: + version: v2024.6.12 + container_name: harmony-container + image: harmony + ports: + - "8000:8000" From eab1fd4c5ecebf3b32f91134b147a97b733a0516 Mon Sep 17 00:00:00 2001 From: Julian Anderson Date: Fri, 21 Jun 2024 23:27:00 -0400 Subject: [PATCH 2/4] build(docker): specify deno container tag --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f15ef0a..f77026b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM denoland/deno +FROM denoland/deno:alpine-1.44.4 EXPOSE 8000 From 82ae57c8e0d61a1f042404833eb0850ca3b11f70 Mon Sep 17 00:00:00 2001 From: Julian Anderson Date: Fri, 21 Jun 2024 23:29:29 -0400 Subject: [PATCH 3/4] refactor(docker): remove redundant suffix Co-authored-by: Michael Wiencek --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6a5c092..b800f65 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: context: . args: version: v2024.6.12 - container_name: harmony-container + container_name: harmony image: harmony ports: - "8000:8000" From e8ec58e55176320ab47c0c91b797c16ff5ecb7a3 Mon Sep 17 00:00:00 2001 From: Julian Anderson Date: Fri, 21 Jun 2024 23:31:33 -0400 Subject: [PATCH 4/4] build(docker): run deno as non-root user --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index f77026b..ee48b9e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,4 +10,5 @@ RUN deno cache server/main.ts ARG version ENV DENO_DEPLOYMENT_ID $version +USER deno:deno CMD deno run -A server/main.ts