frigjordF
Denoβ€’3y agoβ€’
12 replies
frigjord

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

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"]

Using https://deno.land/std@0.123.0/http/server.ts works fine on local dev.
Was this page helpful?