Skip to content

Commit 0a5dcad

Browse files
authored
Added init-proxy script. (#24)
1 parent abda36b commit 0a5dcad

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ LABEL maintainer="Hyperf Developers <[email protected]>" version="1.0" license="MI
1515
ARG timezone
1616

1717
ENV TIMEZONE=${timezone:-"Asia/Shanghai"} \
18-
COMPOSER_VERSION=1.8.6 \
18+
COMPOSER_VERSION=1.9.0 \
1919
APP_ENV=prod
2020

2121
# update
@@ -45,13 +45,16 @@ RUN set -ex \
4545
&& rm -rf /var/cache/apk/* /tmp/* /usr/share/man \
4646
&& echo -e "\033[42;37m Build Completed :).\033[0m\n"
4747

48-
COPY . /opt/www
49-
5048
WORKDIR /opt/www
5149

50+
# Composer Cache
51+
# COPY ./composer.* /opt/www/
52+
# RUN composer install --no-dev
53+
54+
COPY . /opt/www
5255
RUN composer install --no-dev \
5356
&& composer dump-autoload -o \
54-
&& php /opt/www/bin/hyperf.php di:init-proxy
57+
&& composer init-proxy
5558

5659
EXPOSE 9501
5760

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
"test": "co-phpunit -c phpunit.xml --colors=always",
7979
"cs-fix": "php-cs-fixer fix $1",
8080
"analyze": "phpstan analyse --memory-limit 300M -l 0 -c phpstan.neon ./app ./config",
81-
"start": "php ./bin/hyperf.php start"
81+
"start": "php ./bin/hyperf.php start",
82+
"init-proxy": "init-proxy.sh"
8283
}
8384
}

0 commit comments

Comments
 (0)