'Colors for terminal with curl in docker container
I have a very simple Node.js app:
import terminalImage from 'terminal-image';
import express from 'express';
const app = express();
app.post("/", async (req, res) => {
res.send(await terminalImage.file('image.png', {width: 85, height: 45, preserveAspectRatio: false}));
});
app.listen(80);
Which works just fine in my Windows if I send post request using curl to localhost:80. But if I run the same app as docker container on my server, the image has no colors, just white squares. The Dockerfile im using:
FROM node:16
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 80
CMD [ "node", "app.mjs" ]
How to fix it?
Solution 1:[1]
After adding the -it flag everything now working!
docker run -d -it -p 80:80 --name CurlImageApp curlimageapp:latest
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Bohdan |
