-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Dev Container option and promote latest versions
* use `hyperf/hyperf:8.3-alpine-v3.19-swoole` instead. --------- Co-authored-by: 李铭昕 <[email protected]>
- Loading branch information
1 parent
584feaa
commit 4ad5274
Showing
5 changed files
with
75 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Dev Container Dockerfile | ||
# | ||
# @link https://www.hyperf.io | ||
# @document https://hyperf.wiki | ||
# @contact [email protected] | ||
# @license https://github.com/hyperf/hyperf/blob/master/LICENSE | ||
|
||
FROM hyperf/hyperf:8.3-alpine-v3.19-swoole | ||
LABEL maintainer="Hyperf Developers <[email protected]>" version="1.0" license="MIT" app.name="Hyperf" | ||
|
||
## | ||
# ---------- env settings ---------- | ||
## | ||
# --build-arg timezone=Asia/Shanghai | ||
ARG timezone | ||
|
||
ENV TIMEZONE=${timezone:-"Asia/Shanghai"} \ | ||
APP_ENV=dev \ | ||
SCAN_CACHEABLE=(false) | ||
|
||
# update | ||
RUN set -ex \ | ||
# show php version and extensions | ||
&& php -v \ | ||
&& php -m \ | ||
&& php --ri swoole \ | ||
# ---------- some config ---------- | ||
&& cd /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" | ||
|
||
WORKDIR /opt/www | ||
|
||
# Composer Cache | ||
# COPY ./composer.* /opt/www/ | ||
# RUN composer install --no-dev --no-scripts | ||
|
||
COPY . /opt/www | ||
RUN composer install && php bin/hyperf.php | ||
|
||
EXPOSE 9501 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"build": { | ||
"context": "..", | ||
"dockerfile": "./Dockerfile" | ||
}, | ||
"forwardPorts": [9501] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
# @contact [email protected] | ||
# @license https://github.com/hyperf/hyperf/blob/master/LICENSE | ||
|
||
FROM hyperf/hyperf:8.1-alpine-v3.18-swoole | ||
FROM hyperf/hyperf:8.3-alpine-v3.19-swoole | ||
LABEL maintainer="Hyperf Developers <[email protected]>" version="1.0" license="MIT" app.name="Hyperf" | ||
|
||
## | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
# @contact [email protected] | ||
# @license https://github.com/hyperf/hyperf/blob/master/LICENSE | ||
|
||
FROM hyperf/hyperf:8.1-alpine-v3.18-swoole | ||
FROM hyperf/hyperf:8.3-alpine-v3.19-swoole | ||
LABEL maintainer="Hyperf Developers <[email protected]>" version="1.0" license="MIT" app.name="Hyperf" | ||
|
||
## | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="false" | ||
bootstrap="./test/bootstrap.php" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false"> | ||
<testsuites> | ||
<testsuite name="Tests"> | ||
<directory suffix="Test.php">./test</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist processUncoveredFilesFromWhitelist="true"> | ||
<directory suffix=".php">./app</directory> | ||
</whitelist> | ||
</filter> | ||
<php> | ||
<env name="APP_ENV" value="testing" force="true"/> | ||
</php> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="./test/bootstrap.php" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false"> | ||
<testsuites> | ||
<testsuite name="Tests"> | ||
<directory suffix="Test.php">./test</directory> | ||
</testsuite> | ||
</testsuites> | ||
<php> | ||
<env name="APP_ENV" value="testing" force="true"/> | ||
</php> | ||
<source> | ||
<include> | ||
<directory suffix=".php">./app</directory> | ||
</include> | ||
</source> | ||
</phpunit> |