fix: serve avatar files from node process (express.static)
Build + push avatar image / build-and-push (push) Failing after 19s

Single-container avatar service: serve the resized files from outputDir
so the frontend can GET /<md5(jid)>.jpg without a separate nginx.
This commit is contained in:
macanhhuy
2026-08-22 12:19:50 +07:00
parent 8493d8b09b
commit 0669f87134
+6
View File
@@ -44,6 +44,12 @@ app.use(bodyParser.raw( { limit: '10mb', type: 'image/*' }));
app.use(logger('dev'));
app.use(cors(corsOpts));
// Serve the resized avatar files (GET /<md5(jid)>.jpg) straight from outputDir.
// The frontend reads `${avatarServiceUrl}/${hash}.jpg`; historically an nginx
// sharing the outputDir volume did this, but serving it from the node process
// keeps the deployment a single container with one port.
app.use(express.static(outputDir));
// function store
function resizeAndSave(buf, jidhash) {
if (resolutions.length > 0) {