Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docker): Add option to run via Docker Compose #40

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM denoland/deno:alpine-1.44.4

EXPOSE 8000

WORKDIR /app

ADD . /app
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A .dockerignore file should probably be added (with the same or similar entries as .gitignore) so that this doesn't copy unwanted stuff.


RUN deno cache server/main.ts

ARG version
ENV DENO_DEPLOYMENT_ID $version
USER deno:deno
CMD deno run -A server/main.ts
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
services:
web:
build:
context: .
args:
version: v2024.6.12
container_name: harmony
image: harmony
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tagging the image with $DENO_DEPLOYMENT_ID might make sense? (I don't have much Deno experience, so not sure if this variable is ideal for versioning.)

Suggested change
image: harmony
image: harmony:$DENO_DEPLOYMENT_ID

ports:
- "8000:8000"