dix docker

This commit is contained in:
salvacybersec
2025-11-11 04:43:08 +03:00
parent 05bb2fc55c
commit e339477f66
6 changed files with 3898 additions and 8 deletions

2
.gitignore vendored
View File

@@ -1,6 +1,6 @@
# Dependencies # Dependencies
node_modules/ node_modules/
package-lock.json # package-lock.json should be committed for production builds!
# Environment variables # Environment variables
.env .env

View File

@@ -10,7 +10,12 @@ WORKDIR /app
COPY package*.json ./ COPY package*.json ./
# Install dependencies # Install dependencies
RUN npm ci --only=production # Use npm ci if package-lock.json exists, otherwise npm install
RUN if [ -f package-lock.json ]; then \
npm ci --omit=dev; \
else \
npm install --only=production; \
fi
# Stage 2: Production stage # Stage 2: Production stage
FROM node:20-alpine FROM node:20-alpine

View File

@@ -1,5 +1,3 @@
version: '3.8'
# Development Docker Compose # Development Docker Compose
# Hot reload enabled, volumes mounted # Hot reload enabled, volumes mounted

View File

@@ -1,5 +1,3 @@
version: '3.8'
services: services:
# Backend Service # Backend Service
backend: backend:

View File

@@ -10,7 +10,12 @@ WORKDIR /app
COPY package*.json ./ COPY package*.json ./
# Install dependencies # Install dependencies
RUN npm ci # Use npm ci if package-lock.json exists, otherwise npm install
RUN if [ -f package-lock.json ]; then \
npm ci; \
else \
npm install; \
fi
# Copy application code # Copy application code
COPY . . COPY . .
@@ -32,7 +37,11 @@ COPY --from=builder --chown=oltalama:oltalama /app/dist ./dist
COPY --from=builder --chown=oltalama:oltalama /app/package*.json ./ COPY --from=builder --chown=oltalama:oltalama /app/package*.json ./
# Install only production dependencies (for preview server) # Install only production dependencies (for preview server)
RUN npm ci --only=production RUN if [ -f package-lock.json ]; then \
npm ci --omit=dev; \
else \
npm install --only=production; \
fi
# Switch to non-root user # Switch to non-root user
USER oltalama USER oltalama

3880
frontend/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff