Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Node modules
node_modules/

# Logs
logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Runtime data
pids/
*.pid
*.seed
*.pid.lock

# dotenv
.env
.env.local
.env.*.local

# OS
.DS_Store
Thumbs.db

# IDE / Editor config
.vscode/
.idea/
*.suo
*.ntvs*
*.njsproj
*.sln

# Build output
dist/
build/
coverage/

# Optional: jeśli używasz TypeScript
*.tsbuildinfo
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Etap 1: Build + instalacja zależności
FROM node:24-alpine AS builder

WORKDIR /app

# Kopiuj tylko package*.json – to pozwala skorzystać z cache
COPY package*.json ./

# Instaluj tylko produkcyjne zależności
RUN npm install --production && npm cache clean --force && \
find node_modules -type d -name "test" -o -name "__tests__" | xargs rm -rf && \
find node_modules -type f -name "*.md" -o -name "*.ts" | xargs rm -f

# Skopiuj resztę plików aplikacji
COPY server.js ./

# Etap 2: Czysty, lekki obraz
FROM node:24-alpine

WORKDIR /app

# Skopiuj tylko zbudowaną aplikację + node_modules z buildera
COPY --from=builder /app /app

# Ustaw port
EXPOSE 3000

# Uruchom aplikację
CMD [ "npm", "start" ]
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,16 @@
"dependencies": {
"cors": "^2.8.5",
"express": "^5.1.0",
"multer": "^2.0.1"
"multer": "^2.0.1",
"morgan": "^1.10.0",
"fs": "^0.0.1-security",
"path": "^0.12.7",
"sanitize-html": "^2.12.1",
"sqlite3": "^5.1.7",
"body-parser": "^1.20.2",
"bcryptjs": "^2.4.3",
"nodemailer": "^6.9.13",
"jsonwebtoken": "^9.0.2"
},
"description": ""
}
Loading