# Stage 1: Use Alpine to install required tools FROM alpine:latest AS builder RUN apk add --no-cache curl jq # Stage 2: Use the original image FROM reddravenn/stremio-tmdb-dice:latest # Copy required binaries from Alpine stage COPY --from=builder /usr/bin/curl /usr/bin/curl COPY --from=builder /usr/bin/jq /usr/bin/jq # Create necessary directories with proper permissions RUN mkdir -p /usr/src/app/log /usr/src/app/cache /usr/src/app/public && \ chmod -R 755 /usr/src/app && \ chown -R node:node /usr/src/app # Ensure necessary files and directories have correct permissions RUN chmod -R 755 /usr/src/app && \ chown -R node:node /usr/src/app # Set user to node for better security USER node # Expose the port the application runs on EXPOSE 7000 # Set environment variables # BASE_URL=http://localhost:7000 # CATALOG_CONTENT_CACHE_DURATION=3d # RPDB_POSTER_CACHE_DURATION=3d # LOG_INTERVAL_DELETION=3d # LOG_LEVEL=info # NODE_ENV=production # PORT=7000 # Run the application CMD ["node", "index.js"]