test-deploy

This commit is contained in:
richardtekula
2025-12-02 09:48:42 +01:00
parent ffaf916f5e
commit ba11af5773
2 changed files with 46 additions and 0 deletions

17
.dockerignore Normal file
View File

@@ -0,0 +1,17 @@
node_modules
npm-debug.log
.env
.env.local
.git
.gitignore
README.md
.DS_Store
*.md
tests
__tests__
coverage
.nyc_output
.eslintrc*
.prettierrc*
docker-compose*.yml
postgres

29
Dockerfile Normal file
View File

@@ -0,0 +1,29 @@
FROM node:20-alpine
WORKDIR /app
# Kopírovanie package súborov
COPY package*.json ./
# Inštalácia závislostí (len produkčné)
RUN npm ci --only=production
# Kopírovanie zdrojového kódu
COPY src ./src
COPY drizzle.config.js ./
# Vytvorenie adresára pre uploady
RUN mkdir -p uploads
# Nastavenie používateľa (bezpečnosť)
RUN addgroup -g 1001 -S nodejs && \
adduser -S nodejs -u 1001 && \
chown -R nodejs:nodejs /app
USER nodejs
# Port
EXPOSE 5000
# Spustenie
CMD ["node", "src/index.js"]