Robin Lindner
Robin Lindner
Explore posts from servers
DDeno
Created by Robin Lindner on 3/1/2024 in #help
Structure microservices
Hi, how would you structure a Deno microservice repository with a good developer experience (good debugging, ..., communication using message brokers)? Do you have any example?
3 replies
DDeno
Created by Robin Lindner on 6/16/2023 in #help
Running deno in distroless image does not work well
Hey, I have the following Dockerfile:
FROM node:lts AS build
WORKDIR /app
COPY .npmrc package.json pnpm-lock.yaml ./
RUN npm install -g pnpm \
&& pnpm fetch --prod
COPY . ./
RUN pnpm install -r --offline --prod \
&& pnpm build

# Run
FROM denoland/deno:distroless-1.34.2
USER deno
COPY --from=build --chown=deno:deno /app/dist/ /app/
WORKDIR /app/server
ENV HOST=0.0.0.0
ENV Port=3000
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD curl --fail http://localhost:3000 || exit 1
CMD ["run", "--allow-net", "--allow-read", "--allow-env", "entry.mjs"]
FROM node:lts AS build
WORKDIR /app
COPY .npmrc package.json pnpm-lock.yaml ./
RUN npm install -g pnpm \
&& pnpm fetch --prod
COPY . ./
RUN pnpm install -r --offline --prod \
&& pnpm build

# Run
FROM denoland/deno:distroless-1.34.2
USER deno
COPY --from=build --chown=deno:deno /app/dist/ /app/
WORKDIR /app/server
ENV HOST=0.0.0.0
ENV Port=3000
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD curl --fail http://localhost:3000 || exit 1
CMD ["run", "--allow-net", "--allow-read", "--allow-env", "entry.mjs"]
But for some reason I get some error:
$ docker run asciity:0.1.0 -p 3000:3000
docker: Error response from daemon: unable to find user deno: no matching entries in passwd file.
$ docker run asciity:0.1.0 -p 3000:3000
docker: Error response from daemon: unable to find user deno: no matching entries in passwd file.
. Do you have some idea to fix it?
3 replies
DDeno
Created by Robin Lindner on 10/8/2022 in #help
Static compilation of deno modules
Is there a way to statically compile libraries into the .js bundle instead of dynamically retrieving them from deno.land. The point is that I would like to test the Boa engine in the Deno environment and so the libraries are interfering. Of course the Deno internals have to be implemented afterwards. So that, for example, from the following code:
import { fetch } from "https://deno.land/x/[email protected]/mod.ts";
import { fetch } from "https://deno.land/x/[email protected]/mod.ts";
becomes: the compiled code of https://github.com/lucacasonato/deno_local_file_fetch/blob/main/mod.ts something like:
async function fetch(
input: string | Request | URL,
init?: RequestInit,
): Promise<Response> {
// impl
}
async function fetch(
input: string | Request | URL,
init?: RequestInit,
): Promise<Response> {
// impl
}
5 replies
DDeno
Created by Robin Lindner on 10/7/2022 in #help
[resolved] CI failure TS2684
Hey, I'm currently working on a pull request for the Astro project. Unfortunately the CI doesn't like my code despite the latest Deno version (1.26.1). Does anyone know what the reason is and can possibly give me a solution? GitHub Actions run: https://github.com/withastro/astro/actions/runs/3200178618/jobs/5226807106.
error: TS2694 [ERROR]: Namespace 'Deno' has no exported member 'PermissionOptions'.
error: TS2694 [ERROR]: Namespace 'Deno' has no exported member 'PermissionOptions'.
export const defaultTestPermissions: Deno.PermissionOptions = {
read: true,
net: true,
run: true,
env: true
};
export const defaultTestPermissions: Deno.PermissionOptions = {
read: true,
net: true,
run: true,
env: true
};
3 replies