Skip to content

Commit

Permalink
🥳 Fix horizon startup failure
Browse files Browse the repository at this point in the history
  • Loading branch information
ellermister committed Sep 3, 2024
1 parent 8900ea9 commit 057fde9
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 58 deletions.
67 changes: 31 additions & 36 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ FROM node:${NODE_VERSION}-bullseye-slim as build

WORKDIR /app

ENV PHPRC=/etc/php.ini
ENV PHP_BINARY=/usr/local/bin/php

ADD --chown=root:root --chmod=775 \
https://github.com/dunglas/frankenphp/releases/download/v1.2.5/frankenphp-linux-x86_64 /usr/local/bin/frankenphp
COPY . .

ENV COMPOSER_ALLOW_SUPERUSER=1
COPY --from=composer/composer:2-bin /composer /usr/bin/composer
RUN npm install -g pnpm
RUN pnpm install
RUN pnpm build

#ffmpeg
ADD https://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-6.0.1-amd64-static.tar.xz /tmp

RUN apt update \
Expand All @@ -23,49 +21,46 @@ RUN apt update \
&& cp /tmp/ffmpeg /usr/local/bin/ffmpeg \
&& chmod +x /usr/local/bin/ffmpeg

COPY . .

COPY ./deploy/files/ /

RUN chmod +x /usr/local/bin/php

COPY --from=ochinchina/supervisord:latest /usr/local/bin/supervisord /usr/local/bin/supervisord


RUN npm install -g pnpm
RUN pnpm install
RUN pnpm build

RUN composer install \
--ignore-platform-reqs \
--classmap-authoritative \
--no-interaction \
--no-ansi \
--no-dev

# Run
FROM debian:12
FROM phpswoole/swoole:php8.3-alpine

WORKDIR /app

ENV PHPRC=/etc/php.ini
ENV PHP_BINARY=/usr/local/bin/php

ADD --chown=root:root --chmod=775 \
https://github.com/dunglas/frankenphp/releases/download/v1.2.5/frankenphp-linux-x86_64 /usr/local/bin/frankenphp
https://github.com/yt-dlp/yt-dlp/releases/download/2024.08.06/yt-dlp_linux /usr/local/bin/yt-dlp_linux

ADD --chown=root:root --chmod=775 \
https://github.com/yt-dlp/yt-dlp/releases/download/2024.08.06/yt-dlp_linux /usr/local/bin/yt-dlp_linux
https://github.com/dunglas/frankenphp/releases/download/v1.2.5/frankenphp-linux-x86_64 /usr/local/bin/frankenphp

ENV COMPOSER_ALLOW_SUPERUSER=1

COPY --from=composer/composer:2-bin /composer /usr/bin/composer

COPY --from=build /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg

COPY --from=ochinchina/supervisord:latest /usr/local/bin/supervisord /usr/local/bin/supervisord

COPY ./deploy/files/ /
RUN docker-php-ext-install pcntl

COPY . .
COPY --from=build /app/vendor/ /app/vendor/
COPY --from=build /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg

RUN chmod +x /usr/local/bin/php
RUN rm -f public/storage && php artisan storage:link
COPY ./deploy/files/ /
#COPY --from=build /app/vendor/ /app/vendor/


RUN composer install \
--ignore-platform-reqs \
--classmap-authoritative \
--no-interaction \
--no-ansi \
--no-dev \
&& rm -rf /root/.composer


RUN cp .env.example .env \
&& php artisan key:generate \
&& rm -f public/storage && php artisan storage:link

CMD ["/usr/local/bin/supervisord", "-c", "/etc/supervisord.conf"]
22 changes: 0 additions & 22 deletions deploy/files/usr/local/bin/php

This file was deleted.

0 comments on commit 057fde9

Please sign in to comment.