I developed apps and run them on the docker.
I'd like to see logs during the development.
I can see them by docker logs api-server
.
But now I must send this command every time for debut.
So I decided to enter container by following command.
docker exec -it api-server sh
And then I want to watch logs real timely.
Are there any method to watch realtime logs on server(for example access log) ?
Dockerfile
of api-server
is following
FROM node:alpine
WORKDIR /src
COPY package.json .
RUN rm -rf /src/node_modules
RUN rm -rf /src/package-lock.json
RUN apk --no-cache add curl
RUN yarn install
CMD yarn start:debug
package.json
is following
"scripts": {
"prebuild": "rimraf dist",
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json"
},