Initial project setup (node)
This commit is contained in:
10
.gitignore
vendored
Normal file
10
.gitignore
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
node_modules/
|
||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
.env
|
||||||
|
.venv/
|
||||||
|
dist/
|
||||||
|
build/
|
||||||
|
*.egg-info/
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
13
.vscode/extensions.json
vendored
Normal file
13
.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"recommendations": [
|
||||||
|
"ms-azuretools.vscode-docker",
|
||||||
|
"ms-python.python",
|
||||||
|
"ms-python.black-formatter",
|
||||||
|
"dbaeumer.vscode-eslint",
|
||||||
|
"esbenp.prettier-vscode",
|
||||||
|
"eamodio.gitlens",
|
||||||
|
"ms-vscode-remote.remote-ssh",
|
||||||
|
"redhat.vscode-yaml",
|
||||||
|
"bradlc.vscode-tailwindcss"
|
||||||
|
]
|
||||||
|
}
|
||||||
32
.vscode/settings.json
vendored
Normal file
32
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
// ── Git 설정 ──
|
||||||
|
"git.defaultCloneDirectory": "C:\\Users\\User\\Projects",
|
||||||
|
"git.autofetch": true,
|
||||||
|
"git.confirmSync": false,
|
||||||
|
"git.enableSmartCommit": true,
|
||||||
|
|
||||||
|
// ── 에디터 설정 ──
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"editor.tabSize": 2,
|
||||||
|
"files.eol": "\n",
|
||||||
|
"files.trimTrailingWhitespace": true,
|
||||||
|
"files.insertFinalNewline": true,
|
||||||
|
|
||||||
|
// ── Python 설정 ──
|
||||||
|
"[python]": {
|
||||||
|
"editor.tabSize": 4,
|
||||||
|
"editor.defaultFormatter": "ms-python.black-formatter"
|
||||||
|
},
|
||||||
|
|
||||||
|
// ── Docker 설정 ──
|
||||||
|
"[dockerfile]": {
|
||||||
|
"editor.defaultFormatter": "ms-azuretools.vscode-docker"
|
||||||
|
},
|
||||||
|
|
||||||
|
// ── 터미널 설정 ──
|
||||||
|
"terminal.integrated.defaultProfile.windows": "Git Bash",
|
||||||
|
|
||||||
|
// ── 솔메카 배포 관련 ──
|
||||||
|
"solmeca.gitea.url": "http://100.125.85.86:3000",
|
||||||
|
"solmeca.coolify.url": "http://100.125.85.86:8000"
|
||||||
|
}
|
||||||
124
.vscode/tasks.json
vendored
Normal file
124
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
{
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "Deploy: 자동 배포 (서버 자동 선택)",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "bash",
|
||||||
|
"args": [
|
||||||
|
"C:/Users/User/Desktop/SERVER_ 운영/deploy.sh",
|
||||||
|
"${input:repoName}"
|
||||||
|
],
|
||||||
|
"group": "build",
|
||||||
|
"presentation": {
|
||||||
|
"reveal": "always",
|
||||||
|
"panel": "dedicated",
|
||||||
|
"clear": true
|
||||||
|
},
|
||||||
|
"problemMatcher": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Deploy: 서버 지정 배포",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "bash",
|
||||||
|
"args": [
|
||||||
|
"C:/Users/User/Desktop/SERVER_ 운영/deploy.sh",
|
||||||
|
"${input:repoName}",
|
||||||
|
"${input:appName}",
|
||||||
|
"${input:serverName}"
|
||||||
|
],
|
||||||
|
"group": "build",
|
||||||
|
"presentation": {
|
||||||
|
"reveal": "always",
|
||||||
|
"panel": "dedicated",
|
||||||
|
"clear": true
|
||||||
|
},
|
||||||
|
"problemMatcher": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Deploy: 서버 상태 확인",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "bash",
|
||||||
|
"args": [
|
||||||
|
"C:/Users/User/Desktop/SERVER_ 운영/deploy.sh",
|
||||||
|
"status"
|
||||||
|
],
|
||||||
|
"group": "build",
|
||||||
|
"presentation": {
|
||||||
|
"reveal": "always",
|
||||||
|
"panel": "dedicated",
|
||||||
|
"clear": true
|
||||||
|
},
|
||||||
|
"problemMatcher": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Git: Gitea에 Push",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "git push origin main",
|
||||||
|
"group": "build",
|
||||||
|
"presentation": {
|
||||||
|
"reveal": "always",
|
||||||
|
"panel": "shared"
|
||||||
|
},
|
||||||
|
"problemMatcher": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Git: Commit + Push + Deploy",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "bash",
|
||||||
|
"args": [
|
||||||
|
"-c",
|
||||||
|
"git add -A && git commit -m '${input:commitMsg}' && git push origin main && bash 'C:/Users/User/Desktop/SERVER_ 운영/deploy.sh' $(basename $(git rev-parse --show-toplevel))"
|
||||||
|
],
|
||||||
|
"group": "build",
|
||||||
|
"presentation": {
|
||||||
|
"reveal": "always",
|
||||||
|
"panel": "dedicated",
|
||||||
|
"clear": true
|
||||||
|
},
|
||||||
|
"problemMatcher": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Docker: 로컬 빌드 테스트",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "docker build -t ${input:repoName}:test . && docker run --rm -p 8000:8000 ${input:repoName}:test",
|
||||||
|
"group": "test",
|
||||||
|
"presentation": {
|
||||||
|
"reveal": "always",
|
||||||
|
"panel": "dedicated"
|
||||||
|
},
|
||||||
|
"problemMatcher": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"id": "repoName",
|
||||||
|
"type": "promptString",
|
||||||
|
"description": "Gitea 레포 이름 (예: fastapi-demo)",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "appName",
|
||||||
|
"type": "promptString",
|
||||||
|
"description": "Coolify 앱 이름 (비워두면 레포이름 사용)",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "serverName",
|
||||||
|
"type": "pickString",
|
||||||
|
"description": "배포 서버 선택",
|
||||||
|
"options": [
|
||||||
|
"worker-ai",
|
||||||
|
"worker-downsys",
|
||||||
|
"worker-kakao2"
|
||||||
|
],
|
||||||
|
"default": "worker-ai"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "commitMsg",
|
||||||
|
"type": "promptString",
|
||||||
|
"description": "커밋 메시지",
|
||||||
|
"default": "update"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
9
Dockerfile
Normal file
9
Dockerfile
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
FROM node:20-alpine
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN npm ci --only=production
|
||||||
|
COPY . .
|
||||||
|
EXPOSE 3000
|
||||||
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
||||||
|
CMD wget -qO- http://localhost:3000/health || exit 1
|
||||||
|
CMD ["node", "server.js"]
|
||||||
11
package.json
Normal file
11
package.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"name": "test-node",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "node server.js",
|
||||||
|
"start": "node server.js"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"express": "^4.21.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
15
server.js
Normal file
15
server.js
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
const express = require('express');
|
||||||
|
const app = express();
|
||||||
|
const PORT = process.env.PORT || 3000;
|
||||||
|
|
||||||
|
app.get('/', (req, res) => {
|
||||||
|
res.json({ app: 'test-node', status: 'running', time: new Date().toISOString() });
|
||||||
|
});
|
||||||
|
|
||||||
|
app.get('/health', (req, res) => {
|
||||||
|
res.json({ status: 'ok' });
|
||||||
|
});
|
||||||
|
|
||||||
|
app.listen(PORT, '0.0.0.0', () => {
|
||||||
|
console.log(`test-node running on port ${PORT}`);
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user