Files
Xboard/Dockerfile

48 lines
1.6 KiB
Docker
Raw Permalink Normal View History

2025-01-21 14:57:54 +08:00
FROM phpswoole/swoole:php8.2-alpine
2023-11-17 14:44:01 +08:00
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
2025-02-06 19:04:38 +08:00
# Install PHP extensions one by one with lower optimization level for ARM64 compatibility
2025-02-07 19:58:42 +08:00
RUN CFLAGS="-O0" install-php-extensions pcntl && \
CFLAGS="-O0 -g0" install-php-extensions bcmath && \
2025-02-06 19:04:38 +08:00
install-php-extensions zip && \
install-php-extensions redis && \
apk --no-cache add shadow sqlite mysql-client mysql-dev mariadb-connector-c git patch supervisor redis && \
addgroup -S -g 1000 www && adduser -S -G www -u 1000 www && \
(getent group redis || addgroup -S redis) && \
(getent passwd redis || adduser -S -G redis -H -h /data redis)
2023-11-17 14:44:01 +08:00
WORKDIR /www
2025-02-09 23:10:28 +08:00
2023-11-17 14:44:01 +08:00
COPY .docker /
2025-02-09 23:10:28 +08:00
# Add build arguments
ARG CACHEBUST
ARG REPO_URL
ARG BRANCH_NAME
RUN echo "Attempting to clone branch: ${BRANCH_NAME} from ${REPO_URL} with CACHEBUST: ${CACHEBUST}" && \
rm -rf ./* && \
rm -rf .git && \
git config --global --add safe.directory /www && \
2026-03-11 04:52:06 +08:00
git clone --depth 1 --branch ${BRANCH_NAME} ${REPO_URL} . && \
git submodule update --init --recursive --force
2025-02-09 23:10:28 +08:00
2025-01-21 14:57:54 +08:00
COPY .docker/supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
2025-02-10 00:01:51 +08:00
RUN composer install --no-cache --no-dev \
2025-01-21 14:57:54 +08:00
&& php artisan storage:link \
&& cp -r plugins/ /opt/default-plugins/ \
2025-01-21 14:57:54 +08:00
&& chown -R www:www /www \
&& chmod -R 775 /www \
&& mkdir -p /data \
&& chown redis:redis /data
ENV ENABLE_WEB=true \
ENABLE_HORIZON=true \
ENABLE_REDIS=false \
ENABLE_WS_SERVER=false
2023-11-17 14:44:01 +08:00
2025-01-21 14:57:54 +08:00
EXPOSE 7001
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]