denoland / fresh

The next-gen web framework.
https://fresh.deno.dev
MIT License
12.54k stars 648 forks source link

Deployment: Ahead of time build failed to complete #2177

Closed epikoder closed 8 months ago

epikoder commented 11 months ago

Ahead of time build is stock when running deno task build

Expected Exit on completion

Behviour Stock on this line

Assets written to: /app/_fresh

From the screenshot the left is Docker image denoland/deno:1.38.3 while the right is host machine, I've also tried denoland/deno:1.39.0

Screenshot 2023-12-15 at 11 22 33 PM

Here's my Dockerfile

FROM denoland/deno:1.38.3

ARG GIT_REVISION
ARG DATABASE_HOST=${DATABASE_HOST}
ARG DATABASE_PORT=${DATABASE_PORT}
ARG DATABASE_NAME=${DATABASE_NAME}
ARG DATABASE_USER=${DATABASE_USER}
ARG DATABASE_PASSWORD=${DATABASE_PASSWORD}

ENV DENO_DEPLOYMENT_ID=${GIT_REVISION}

WORKDIR /app

COPY . .
RUN deno task build \
    deno cache main.ts

EXPOSE 8000

CMD ["run", "-A", "main.ts"]
BrunoBernardino commented 8 months ago

I'm not having this problem with Deno 1.41.0, here's my Dockerfile in case it helps:

FROM denoland/deno:alpine-1.41.0

EXPOSE 8000

WORKDIR /app

ADD . /app

RUN rm -fr node_modules _fresh 

RUN deno task build

RUN chown -R deno:deno /app /deno-dir

USER deno

RUN deno cache --reload main.ts

CMD ["run", "--allow-all", "main.ts"]
marvinhagemeister commented 8 months ago

There is likely something that prevents the process from exciting. This usually happens when you're using Deno KV or Deno Queues in build mode.

Duplicate of https://github.com/denoland/fresh/issues/2240