# Use official Node base image FROM node:20-slim # Set working directory WORKDIR /app # Install dependencies RUN apt-get update && apt-get install -y \ curl \ bash \ git \ ca-certificates \ && rm -rf /var/lib/apt/lists/* # Install Encore CLI to a system location that will persist RUN curl -L https://encore.dev/install.sh | bash && \ cp /root/.encore/bin/encore /usr/local/bin/encore && \ chmod +x /usr/local/bin/encore # Verify installation RUN /usr/local/bin/encore version # Copy workspace files COPY package*.json ./ COPY backend ./backend # Move into backend workspace WORKDIR /app/backend # Install Node dependencies RUN npm install # Fix permissions - ensure the container can write to the backend directory RUN chmod -R 777 /app/backend # Expose app port EXPOSE 7860 # Environment variables ENV NODE_ENV=production ENV PORT=7860 # Copy start script COPY start.sh /app/start.sh RUN chmod +x /app/start.sh # Start Encore app CMD ["/app/start.sh"]