Building T3 app with Docker. Image access issue (sharp).

I have a quite simple app based on T3 template. I want to deploy it with Docker, so i'm building Docker image as it suggested in docks. Image are building successfully, app runs, but image optimisation do not work. In console i see error that i need to add "sharp" npm package explicitly to make it work. After installation, <Images /> that are added as usual works fine, but images that are added in a way that are shown on screenshot - fails with 500 error, and server die. In console i see socket errors. In very-very rare cases 1-2 of 5 images loads, but in next run of same image they all can fail 😕 When it is deployed to Vercel - everything works fine. (no errors, server alive, everything 'webp' When i replace Image -> img in that map, everything works fine. (This images are not optimised (still png), least images are transformed png -> webp) Question: How to fix that issue with Image optimisation? FIXED (check comments below) New question: Why create-t3-app have this insane (23sec) image loading time? How i can improve it?
5 Replies
MadaShindeInai
MadaShindeInaiâ€ĸ13mo ago
upd. created a clear next-app, copied images, installed sharp, add the same code for <Images />, built it with docker, everything works fine. The difference i see is that T3 latest version have next version 13.4.1 and create next app - 13.4.3. Trying to check if updating next version helps
MadaShindeInai
MadaShindeInaiâ€ĸ13mo ago
upd. removing of lines on screenshot 1 from next.config.mjs removed a problem with app crash, but images loading for some crazy amount of time. Created new fresh t3 app, added images, added sharp and mapping => results on screenshot 2
MadaShindeInai
MadaShindeInaiâ€ĸ13mo ago
Same metrics, but for bare create next-app thinkies
MadaShindeInai
MadaShindeInaiâ€ĸ13mo ago
GitHub
GitHub - MadaShindeInai/t3-docker-sharp
Contribute to MadaShindeInai/t3-docker-sharp development by creating an account on GitHub.
GitHub
GitHub - MadaShindeInai/next-docker-sharp: create next-app template...
create next-app template with docker and sharp installed - GitHub - MadaShindeInai/next-docker-sharp: create next-app template with docker and sharp installed
MadaShindeInai
MadaShindeInaiâ€ĸ13mo ago
Well, the problem was with building and running image on mac m1. Config (docker image) that works with Images too slow locally, works good on railway. And do not work on fly.io at all ☚ī¸
Want results from more Discord servers?
Add your server
More Posts