first commit
This commit is contained in:
+56
@@ -0,0 +1,56 @@
|
||||
FROM php:7.4-cli-alpine3.13
|
||||
# Set working dir.
|
||||
WORKDIR /app
|
||||
|
||||
# Change alpinelinux source.
|
||||
# Reference: https://github.com/laradock/laradock
|
||||
RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g" /etc/apk/repositories ;
|
||||
|
||||
RUN uname -a && \
|
||||
apk update
|
||||
|
||||
RUN apk add git zip vim bash openssh
|
||||
|
||||
RUN php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');" && \
|
||||
php composer-setup.php && \
|
||||
php -r "unlink('composer-setup.php');" && \
|
||||
mv composer.phar /usr/local/bin/composer && \
|
||||
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
|
||||
|
||||
|
||||
RUN docker-php-ext-install sockets pcntl && \
|
||||
docker-php-ext-install pdo_mysql
|
||||
|
||||
RUN apk add --no-cache pcre-dev $PHPIZE_DEPS && \
|
||||
pecl install redis && \
|
||||
docker-php-ext-enable redis
|
||||
|
||||
RUN apk add --no-cache libevent-dev openssl-dev libressl-dev && \
|
||||
pecl install event && \
|
||||
echo extension=event.so > /usr/local/etc/php/conf.d/event.ini
|
||||
|
||||
# update
|
||||
RUN set -ex \
|
||||
# show php version and extensions
|
||||
&& php -v \
|
||||
&& php -m \
|
||||
# ---------- some config ----------
|
||||
&& cd /usr/local/etc/php \
|
||||
# - config PHP
|
||||
&& { \
|
||||
echo "upload_max_filesize=128M"; \
|
||||
echo "post_max_size=128M"; \
|
||||
echo "memory_limit=1G"; \
|
||||
echo "date.timezone=${TIMEZONE}"; \
|
||||
} | tee conf.d/99_overrides.ini \
|
||||
# - config timezone
|
||||
&& ln -sf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime \
|
||||
&& echo "${TIMEZONE}" > /etc/timezone \
|
||||
# ---------- clear works ----------
|
||||
&& rm -rf /var/cache/apk/* /tmp/* /usr/share/man \
|
||||
&& echo -e "\033[42;37m Build Completed :).\033[0m\n"
|
||||
|
||||
|
||||
|
||||
|
||||
EXPOSE 8787
|
||||
Reference in New Issue
Block a user