Coder Social home page Coder Social logo

Comments (6)

webdeb avatar webdeb commented on April 28, 2024 2

@hayd sure!

Please feel free to include it, I just copied what I have locally in my project (just updated it according to the new release):

FROM hayd/alpine-deno:1.5.2 as build
ADD . .
RUN deno bundle --importmap=./import_map.json --unstable ./app.ts /tmp/app.bundle.js

# --- build the final image, include only the app.bundle.js
FROM hayd/alpine-deno:1.5.2
WORKDIR /app
USER deno
ENV MODE=production

COPY --from=build /tmp/app.bundle.js /app/app.bundle.js
CMD ["deno", "run", "--allow-net", "--allow-env", "--allow-read", "/app/app.bundle.js"]

from deno_docker.

webdeb avatar webdeb commented on April 28, 2024

Not exactly sure how this is related, but I am running a multi-stage build by running deno bundle app.ts app.bundle.js in the first stage and then copying the produced file into the final image. Works nice! This is a just a simple events handler and the size of the app.bundle.js is about 450kb.

from deno_docker.

hayd avatar hayd commented on April 28, 2024

@webdeb An example like that would be really nice for the README, I think that's a better option that running bundle locally (on potentially another deno version) then using that file 👍

from deno_docker.

CanRau avatar CanRau commented on April 28, 2024

@webdeb Why use bundle and not compile?

Trying to "improve" my Dockerfile though both of those produce the same error, which I not get running the server using deno run

The bundle'd at least show a more insightful error & lets me inspect

error: Uncaught ReferenceError: Cannot access 'Error' before initialization
class DenoStdInternalError extends Error {

Thoug I've no idea what to do, probably opening a new issue @ denoland/deno right?

from deno_docker.

webdeb avatar webdeb commented on April 28, 2024

@CanRau Oh your are right. I guess by that time the compile command wasn't available.
Your error seems weird and reporting it is a good idea, however to fix workaround your problem maybe you could try to define a Variable like const ExtendableError = Error
and then use it like MyError extend ExtendableError {}
Don't know if this will work, but it could ;)

from deno_docker.

CanRau avatar CanRau commented on April 28, 2024

Huh, just found denoland/deno#12086 and it's "duplicate" denoland/deno#12477

@webdeb I'm not directly using Error in my code, at least as far as I recall

from deno_docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.