FROM ubuntu:22.04 ENV DEBIAN_FRONTEND=noninteractive ENV APP_HOME=/app ENV PORT=7860 RUN apt-get update && apt-get install -y \ nginx \ php8.1-fpm \ php8.1-cli \ php8.1-curl \ php8.1-mbstring \ php8.1-zip \ ffmpeg \ tesseract-ocr \ build-essential \ ca-certificates \ curl \ zip \ unzip \ python3 \ python3-pip \ && pip3 install --no-cache-dir yt-dlp \ && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY nginx.conf /etc/nginx/sites-available/default COPY c/Makefile /app/Makefile COPY c/videoextract.c /app/videoextract.c COPY public /app/public COPY api /app/api RUN make RUN mkdir -p /app/storage/uploads /app/storage/receipts /app/storage/generated /app/storage/dmgs RUN chown -R www-data:www-data /app/storage /app/public /app/api RUN mkdir -p /run/php && \ sed -i 's|;listen.owner = www-data|listen.owner = www-data|' /etc/php/8.1/fpm/pool.d/www.conf && \ sed -i 's|;listen.group = www-data|listen.group = www-data|' /etc/php/8.1/fpm/pool.d/www.conf RUN rm -f /etc/nginx/sites-enabled/default && \ ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default EXPOSE 7860 CMD service php8.1-fpm start && nginx -g "daemon off;"