kushranada
kushranada16mo ago

Fresh in a Docker exiting process

Not sure whats going wrong. Works fine on deno deploy. But when trying to run it inside a docker container the process exits shortly after starting. https://github.com/Robspin/deno-fresh-blog My Dockerfile:
FROM denoland/deno:1.31.1

ARG GIT_REVISION
ENV DENO_DEPLOYMENT_ID=${GIT_REVISION}

WORKDIR /app

COPY . .
RUN deno cache main.ts --import-map=import_map.json

EXPOSE 8000

CMD ["task", "production"]
FROM denoland/deno:1.31.1

ARG GIT_REVISION
ENV DENO_DEPLOYMENT_ID=${GIT_REVISION}

WORKDIR /app

COPY . .
RUN deno cache main.ts --import-map=import_map.json

EXPOSE 8000

CMD ["task", "production"]
Does anyone have any thoughts or similar experience?
GitHub
GitHub - Robspin/deno-fresh-blog
Contribute to Robspin/deno-fresh-blog development by creating an account on GitHub.
7 Replies
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
kushranada
kushranada16mo ago
Yes it logs the CMD: Task production deno run -A main.ts And then nothing. It just says EXITED(1) Its as if the container doesnt stay alive by the await start in main.ts...
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
kushranada
kushranada16mo ago
I think since the base image is deno, the CMD automatically uses deno. I tried adding deno in the CMD but it behaves the same; it runs the command then immediately exits with code (1).
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
kushranada
kushranada16mo ago
I copy pasted the docker example from the Fresh docs. I think something might be going wrong dependency related. But I have no idea how to debug this as I dont get any errors and it works fine locally without a container and on deno deploy.
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View