-
Notifications
You must be signed in to change notification settings - Fork 661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker single executable / memory consumption #2757
Comments
Will this be possible with the release of Deno 2.1.0?
|
@predaytor hi, I think since Deno 2.1.3, You can compile the fresh app with single executable file then copy and run in a low memory environment. Can take reference of my Dockerfile |
@janjangao interesting. for some reason I am getting "Not Found" for my routes. The directly described API endpoints (GET/POST) are working properly: upd: it's a canary version import { App, fsRoutes, staticFiles, trailingSlashes } from 'fresh';
import { satoriApi } from '~/api/satori.tsx';
import { subscribeApi } from '~/api/subscribe.ts';
import { cors } from '~/middleware/cors.ts';
import { secureHeaders } from '~/middleware/security-headers.ts';
export const app = new App<State>({ root: import.meta.url });
app.use(staticFiles());
app.use(trailingSlashes('never'));
app.use(cors);
app.use(secureHeaders);
app.post('/api/subscribe', subscribeApi);
app.get('/api/satori', satoriApi);
await fsRoutes(app, {
dir: './',
loadIsland: (path) => import(`./islands/${path}`),
loadRoute: (path) => import(`./routes/${path}`),
});
if (import.meta.main) {
await app.listen();
} |
on Canary it's about ~370 MB of memory consumption, in addition to static files and routes not working. |
oh, I didn't write complex logic like this, maybe let me proceed try my webside to see if have same issue. |
also, let me try the canary version later |
Is it possible to reduce memory consumption with Fresh 2.0? Currently deployed on fly.io on a 1024MB machine, while a similar application on Node.js consumes around 190-220MB of RAM. Maybe we can create a single executable and get rid of typescript transpilation at runtime? Very thanks.
The text was updated successfully, but these errors were encountered: