test-deploy
This commit is contained in:
17
.dockerignore
Normal file
17
.dockerignore
Normal 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
29
Dockerfile
Normal 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"]
|
||||
Reference in New Issue
Block a user