25 lines
839 B
Docker
25 lines
839 B
Docker
FROM php:7.4-fpm
|
||
|
||
WORKDIR /var/www/html
|
||
|
||
COPY ./app/ /var/www/html/
|
||
|
||
RUN apt-get update && apt-get install -y \
|
||
nginx libzip-dev zip unzip git curl bash supervisor cron \
|
||
&& docker-php-ext-install pdo_mysql mysqli bcmath zip fileinfo pcntl \
|
||
&& pecl install redis \ && docker-php-ext-enable redis \
|
||
&& rm -rf /var/lib/apt/lists/*
|
||
|
||
COPY ./data/nginx.conf /etc/nginx/conf.d/default.conf
|
||
COPY ./data/supervisor.conf /etc/supervisor/conf.d/supervisord.conf
|
||
COPY ./data/cron.d/schedule /etc/cron.d/schedule
|
||
COPY ./data/php/www.conf /usr/local/etc/php-fpm.d/www.conf
|
||
|
||
# 启动脚本:执行初始化,再启动php-fpm
|
||
RUN chown -R www-data:www-data /var/www/html \
|
||
&& chmod -R 777 storage bootstrap/cache \
|
||
&& chmod +x /var/www/html/init.sh && chmod 644 /etc/cron.d/schedule
|
||
|
||
EXPOSE 8045
|
||
|
||
ENTRYPOINT ["sh", "-c", "supervisord -n"] |