We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
# Remove all unused containers, networks, images and volumes docker system prune --volumes -f # Remove all unused images docker system prune -a -f
Create a .dockerignore file with:
.dockerignore
# Node node_modules npm-debug.log yarn-debug.log yarn-error.log # Development .git .gitignore .env .env.local .env.*.local *.md .vscode .idea # Testing coverage .nyc_output test # Build dist build .next out # Misc .DS_Store *.log
# Use slim base image FROM node:18-slim # Set working directory WORKDIR /app # Copy only package files first COPY package*.json ./ # Install dependencies RUN npm ci --only=production # Copy only necessary files COPY src/ ./src/ COPY public/ ./public/ # Set environment ENV PORT=8080 EXPOSE 8080 # Start the app CMD ["node", "src/server.js"]
# Build with optimized options docker build --no-cache --compress -t disc-assessment .
Please implement these changes to resolve the disk space issue.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Docker Build Optimization
1. Cleanup Commands
2. .dockerignore Configuration
Create a
.dockerignore
file with:3. Optimized Dockerfile
4. Build Command with Optimization
Steps to Implement:
Please implement these changes to resolve the disk space issue.
The text was updated successfully, but these errors were encountered: