52 lines
1.6 KiB
Docker
52 lines
1.6 KiB
Docker
# 存客宝后端 - ThinkPHP 7.4 + Nginx + PHP-FPM
|
|
FROM php:7.4-fpm-alpine
|
|
|
|
RUN apk add --no-cache \
|
|
nginx \
|
|
supervisor \
|
|
git \
|
|
unzip \
|
|
curl \
|
|
libzip-dev \
|
|
libpng-dev \
|
|
libjpeg-turbo-dev \
|
|
freetype-dev \
|
|
oniguruma-dev \
|
|
icu-dev \
|
|
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
|
&& docker-php-ext-install -j$(nproc) \
|
|
pdo_mysql \
|
|
mysqli \
|
|
zip \
|
|
gd \
|
|
bcmath \
|
|
opcache \
|
|
intl \
|
|
mbstring \
|
|
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
|
|
&& pecl install redis \
|
|
&& docker-php-ext-enable redis \
|
|
&& apk del .build-deps
|
|
|
|
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
|
|
|
|
COPY docker/nginx.conf /etc/nginx/nginx.conf
|
|
COPY docker/default.conf /etc/nginx/http.d/default.conf
|
|
COPY docker/php.ini /usr/local/etc/php/php.ini
|
|
COPY docker/www.conf /usr/local/etc/php-fpm.d/www.conf
|
|
COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
|
|
|
WORKDIR /var/www/html
|
|
COPY . .
|
|
|
|
RUN composer config --no-plugins allow-plugins.easywechat-composer/easywechat-composer true \
|
|
&& composer config --no-plugins allow-plugins.topthink/think-installer true \
|
|
&& composer install --no-dev --optimize-autoloader --no-interaction --no-security-blocking \
|
|
&& mkdir -p runtime/cache runtime/log runtime/temp \
|
|
/var/log/supervisor /var/run \
|
|
&& chmod -R 777 runtime \
|
|
&& chown -R www-data:www-data /var/www/html
|
|
|
|
EXPOSE 80
|
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|