FROM cloudron/base:5.0.0 MAINTAINER Cloudron Support # Install Node.js 20 and enable corepack for pnpm RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ apt-get install -y nodejs && \ corepack enable # Set up application directory WORKDIR /app/code # Clone and build Docmost RUN git clone https://github.com/docmost/docmost.git . && \ rm -rf .git && \ pnpm install && \ pnpm build && \ mv apps/client/dist /app/client-dist-original && \ ln -s /app/data/client-dist apps/client/dist # Create necessary directories RUN mkdir -p /tmp/data /app/data && \ chown -R cloudron:cloudron /app/data /tmp/data # Copy startup scripts and configuration files COPY start.sh /app/code/ COPY nginx.conf /etc/nginx/sites-available/default COPY env.sample /app/code/env.sample COPY CONFIGURATION.md /app/code/CONFIGURATION.md # Override nginx global logs to prevent read-only filesystem errors RUN sed -i 's|error_log /var/log/nginx/error.log;|error_log /dev/stderr;|' /etc/nginx/nginx.conf && \ sed -i 's|access_log /var/log/nginx/access.log;|access_log /dev/stdout;|' /etc/nginx/nginx.conf # Make scripts executable RUN chmod +x /app/code/start.sh # Install supervisord and netcat for process management and connectivity checks RUN apt-get update && \ apt-get install -y supervisor netcat-openbsd && \ rm -rf /var/lib/apt/lists/* COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf EXPOSE 3000 CMD [ "/app/code/start.sh" ]