How do I deploy my deno/hono server?

steven-tamHOBBY

5 months ago

Since railway doesnt have the same support for deno as node, I went ahead and tried deploying with dockerfile:

FROM denoland/deno:alpine

EXPOSE 8000

WORKDIR /app

COPY . /app

RUN deno cache src/index.ts

CMD ["deno", "task", "start"]

my deno.json which is deno's package.json looks like:

{
"imports": {
"hono": "jsr:@hono/hono@^4.6.14"
},
"tasks": {
"start": "deno run --allow-net src/index.ts"
},
"compilerOptions": {
"jsx": "precompile",
"jsxImportSource": "hono/jsx"
}
}

the only change I made after intializing deno with hono was renaming main.ts to index.ts and moving it into my the src directory I just created. I dont think deno has a build command. This is also my first time using docker

View Deploy details

ⓘ Deployment information is only viewable by project members and Railway employees.

Solved

2 Replies

steven-tamHOBBY

5 months ago

deno 2 is currently unsupported. I ended up using this template https://railway.app/template/zWmKrg


5 months ago

Yep that is the template you would want to use!


Status changed to Solved brody 5 months ago


How do I deploy my deno/hono server? - Railway Help Station