Spaces:
Sleeping
Sleeping
Claude Code Bot Claude commited on
Commit ·
4609fbe
1
Parent(s): 20a3c70
Fix Dockerfile deployment error
Browse files- Simplified Dockerfile to resolve HF build issues
- Removed non-root user setup that was causing errors
- Fixed file naming (keep ollama-server.js instead of renaming)
- Removed health check that might be causing issues
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
1234567891011121314151617181 unmodified line20212223242526272829303132333435363738394041424344454647# Optimized Dockerfile for edi.chat UGA AssistantFROM node:20-alpine# Create app directoryWORKDIR /app# Copy only the essential filesCOPY ollama-server.js ./server.jsCOPY index.html ./# Create optimized package.jsonRUN echo '{\"name": "edichat-optimized",\"version": "1.0.0",\"main": "server.js",\"dependencies": {\"express": "^4.18.2",\"mongoose": "^8.0.0",\1 unmodified line}\}' > package.json# Install dependencies with optimizationsRUN npm install --production --silent --no-audit --no-fund# Set environment variablesENV NODE_ENV=production \PORT=7860 \NO_DATABASE_BLOCKING=true# Create non-root user for securityRUN addgroup -g 1001 -S nodejs && \adduser -S nodejs -u 1001# Change ownership of app directoryRUN chown -R nodejs:nodejs /appUSER nodejs# Expose portEXPOSE 7860# Health checkHEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \CMD wget --quiet --tries=1 --spider http://localhost:7860/health || exit 1# Start serverCMD ["node", "server.js"]1234567891011121314151617181 unmodified line202122232425262728293031323334# Simple Dockerfile for edi.chat UGA AssistantFROM node:20-alpine# Create app directoryWORKDIR /app# Copy filesCOPY ollama-server.js ./COPY index.html ./# Create package.jsonRUN echo '{\"name": "edichat",\"version": "1.0.0",\"main": "ollama-server.js",\"dependencies": {\"express": "^4.18.2",\"mongoose": "^8.0.0",\1 unmodified line}\}' > package.json# Install dependenciesRUN npm install --production --silent# Set environment variablesENV NODE_ENV=production \PORT=7860# Expose portEXPOSE 7860# Start serverCMD ["node", "ollama-server.js"]
Dockerfile+10-23