D
Deno

help

Can't connect to http server on official alpine deno with std serve.

Ffrigjord6/30/2023
I'm using the official alpine docker container to run deno, listening on port 8080, but a simple curl to it and I can't connect. Seems like it isn't listening at all. Deno server shows no error.
# Use the official Deno Docker image with version 1.32.0
FROM denoland/deno:alpine-1.32.0

# Set the working directory inside the container
WORKDIR /app

# Copy the necessary files to the container
COPY . .

RUN deno cache --lock=deno.lock --lock-write deps.ts
RUN deno cache --lock=deno.lock --lock-write server.js
RUN apk add vim curl

# Allow network access to the application
EXPOSE 8080

# Set the entrypoint command to run the Deno application
CMD ["deno", "run", "--allow-net", "--allow-env", "server.js"]
# Use the official Deno Docker image with version 1.32.0
FROM denoland/deno:alpine-1.32.0

# Set the working directory inside the container
WORKDIR /app

# Copy the necessary files to the container
COPY . .

RUN deno cache --lock=deno.lock --lock-write deps.ts
RUN deno cache --lock=deno.lock --lock-write server.js
RUN apk add vim curl

# Allow network access to the application
EXPOSE 8080

# Set the entrypoint command to run the Deno application
CMD ["deno", "run", "--allow-net", "--allow-env", "server.js"]
Using https://deno.land/std@0.123.0/http/server.ts works fine on local dev.
Mmmastrac6/30/2023
If you change EXPOSE 8080 to EXPOSE 8000 does that work? The default port is 8000 and this is exposing 8080. Could you post your server.js file?
Ffrigjord7/1/2023
We've tried most things, custom ports, custom hostnames, with http/https, different servers.
Hhexagon56k7/1/2023
Which comand do you use to run the container? Do you get any logs out of it?
Ffrigjord7/1/2023
Thing is, we're connecting to the deno on the same container it runs on.. Logs aren't giving any clues or errors
export { serve } from "https://deno.land/std@0.123.0/http/server.ts";

async function handler (request, connInfo) {
return new Response('OK');
}

serve(handler, { port: 8080 });
export { serve } from "https://deno.land/std@0.123.0/http/server.ts";

async function handler (request, connInfo) {
return new Response('OK');
}

serve(handler, { port: 8080 });
Found the issue, redis client hanged indefinitely when connecting
Bbartlomieju7/2/2023
Are you using npm:redis?
Ffrigjord7/6/2023
No the top redis package from deno.land
IioB7/6/2023
@iuioiua is this yours?

Looking for more? Join the community!

Recommended Posts
calling a javascript function and waiting for the promise with `rusty_v8````rust let result = function.call(scope, recv, &[]).expect("couldnt run"); /*i got this result whicDeno KV: subtract with `sum` operation?If I do `.sum([key], 1n)` the value is increased by 1. How can I decrease it? I tried `.sum([key], Proxying a Rust API using FFI?I have a rust application that serves a rest api that runs in a container. I also have a deno cli thHow to use declarations from `vite/client`?There are declarations: https://esm.sh/v126/vite@4.3.9/client.d.ts According to documentation, I neegetting errno with ffiI am using ffi to call `execv` and need to get the value of `errno` for failures, but can’t see how Purging Kv keysI have a logger which write logs to a kv store with dual keys, something like ```ts kv.set(["logs_bWhat is the right way to bundle native modules?If I'm not able to import a native module with the built-in "import" keyword, what is the ideal way HandleScope in async opIs there a way to get v8::HandleScope inside async op if I add it as ``` scope: &mut v8::HandleScopDeno LSP randomly breaks until a restart (unable to send result to client)This wasnt an issue until recently. In vscode randomly the lsp stops working. Trying to use the autoIs anyone working on LLMs for Deno so I don't have to learn it in disgusting Python?I'm coming to terms with the reality of having to learn this technology but not on Python.. I mean..Permission denied (os error 13)Please help me, I'm desparate. It doesn't print anything else.Is there a rich text (wysiwyg) editor for deno fresh ?I'm working on a blog, and i need a rich text editor for articles.deno_core usageAre there any repos using deno_core in their code + how would I enable the unstable features and URLError reading `allocUnsafe` using npm:icsHello there, I try to use npm:ics in my project and in some runs it works, in others it doesn't (whiUsing discord.js in Deno?Apparently Deno supports discord.js now. Awesome. But now I can't make it work. According to debug Type alias with inherited type parameter constraintsIs there any way to do this? I want SVLTN to just be a short-name alias for SomeVeryLongTypeName, anFresh: global stateIs it possible to have a global state that can be accessed from anywhere? Currently I'm passing the Run Deno on Linux without /proc mountedI have a few automatic scripts using deno to run stuff, and wanted to migrate them to another MachinReasons to choose Node.jsI've been tasked to write a list of pros/cons of Deno in comparison to Node.js. I am quite honestly Reejs not working on Deno v1.34```js deno run -A npm:reejs [INFO] Saving important data... [TIP] If the error in