feae9882bc
- Updated Dockerfile to create local temp directory with proper permissions - Added volume mount for backend/temp in docker-compose.yml - Improved temp directory fallback logic with multiple alternatives - Added unique timestamps to test files to avoid conflicts - Better logging to identify which temp directory is being used - Try process.cwd()/temp before falling back to OS temp directory This should resolve the persistent EACCES permission errors in Docker containers by ensuring the backend uses a writable temp directory. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
46 lines
1.1 KiB
Docker
46 lines
1.1 KiB
Docker
FROM node:20-alpine
|
|
|
|
# Install MinIO client (detect architecture)
|
|
RUN ARCH=$(uname -m | sed 's/x86_64/amd64/g' | sed 's/aarch64/arm64/g') && \
|
|
wget https://dl.min.io/client/mc/release/linux-${ARCH}/mc && \
|
|
chmod +x mc && \
|
|
mv mc /usr/local/bin/
|
|
|
|
# Create app directory
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package*.json ./
|
|
|
|
# Install build tools for native dependencies (keep them)
|
|
RUN apk add --no-cache python3 make g++ \
|
|
&& rm -rf /app/node_modules
|
|
|
|
# Install production dependencies (will trigger postinstall)
|
|
RUN npm ci --only=production
|
|
|
|
# Copy application files
|
|
COPY . .
|
|
|
|
# Rebuild bcrypt after copying files
|
|
RUN npm rebuild bcrypt --build-from-source
|
|
|
|
# Create non-root user
|
|
RUN addgroup -g 1001 -S nodejs && \
|
|
adduser -S nodejs -u 1001
|
|
|
|
# Create necessary directories with proper permissions
|
|
RUN mkdir -p logs temp /tmp/minio-webui-temp && \
|
|
chown -R nodejs:nodejs /app && \
|
|
chown nodejs:nodejs /tmp/minio-webui-temp && \
|
|
chmod 755 logs temp /tmp/minio-webui-temp && \
|
|
chmod 755 /app/temp
|
|
|
|
# Switch to non-root user
|
|
USER nodejs
|
|
|
|
# Expose port
|
|
EXPOSE 3000
|
|
|
|
# Start the application
|
|
CMD ["node", "src/app.js"] |