Skip to content

Commit

Permalink
feat : save log
Browse files Browse the repository at this point in the history
  • Loading branch information
kangjuhyup committed Jan 23, 2025
1 parent 7628290 commit 452b2a4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/server-ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,10 @@ jobs:
docker pull ghcr.io/${{ github.repository }}/service:latest
docker stop invite-api || true
docker rm invite-api || true
docker run -d -p 3003:3003 --network my-network --name invite-api ghcr.io/${{ github.repository }}/service:latest
docker run -d \
-p 3003:3003 \
--network my-network \
--name invite-api \
--mount type=bind,source=/home/ubuntu/projects/logs,target=/app/logs \
ghcr.io/${{ github.repository }}/service:latest
EOF
2 changes: 2 additions & 0 deletions packages/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ COPY --from=builder /usr/src/app/.env packages/server/.env
COPY --from=builder /usr/src/app/packages/server/public packages/server/public
COPY --from=builder /usr/src/app/packages/server/ecosystem.config.js packages/server/ecosystem.config.js

RUN mkdir -p /app/logs

RUN yarn workspaces focus server --production
RUN npm install -g pm2

Expand Down
3 changes: 3 additions & 0 deletions packages/server/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ export const modules = [
},
}
: undefined,
options: {
destination: 'app/logs/app.log', // 로그 파일 경로
},
},
}),
}),
Expand Down

0 comments on commit 452b2a4

Please sign in to comment.