File tree Expand file tree Collapse file tree 3 files changed +79
-0
lines changed Expand file tree Collapse file tree 3 files changed +79
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * swoole 运行这个文件
4
+ * php swoole.php
5
+ */
6
+ define ('_APP_PATH_ ' , __DIR__ );
7
+
8
+ define ('_APP_PATH_VIEW_ ' , __DIR__ . '/View ' );
9
+
10
+ //define('_DEBUG_',true);
11
+
12
+ require __DIR__ . '/../vendor/autoload.php ' ;
13
+ require __DIR__ . '/../vendor/lizhichao/one/src/run.php ' ;
14
+ require __DIR__ . '/config.php ' ;
15
+
16
+
17
+ \One \Swoole \OneServer::parseArgv ();
18
+
19
+ //\Swoole\Runtime::enableCoroutine();
20
+
21
+ \One \Swoole \OneServer::runAll ();
22
+
23
+
24
+
Original file line number Diff line number Diff line change 24
24
"display_name" : " one" ,
25
25
"notes" : " " ,
26
26
"versus" : " swoole"
27
+ },
28
+ "no-coroutine" : {
29
+ "json_url" : " /json" ,
30
+ "plaintext_url" : " /plaintext" ,
31
+ "db_url" : " /db" ,
32
+ "fortune_url" : " /fortunes" ,
33
+ "update_url" : " /updates/" ,
34
+ "query_url" : " /queries/" ,
35
+ "port" : 8080 ,
36
+ "approach" : " Realistic" ,
37
+ "classification" : " Fullstack" ,
38
+ "database" : " MySQL" ,
39
+ "framework" : " one" ,
40
+ "language" : " PHP" ,
41
+ "flavor" : " None" ,
42
+ "orm" : " Full" ,
43
+ "platform" : " swoole" ,
44
+ "webserver" : " None" ,
45
+ "os" : " Linux" ,
46
+ "database_os" : " Linux" ,
47
+ "display_name" : " one-no-coroutine" ,
48
+ "notes" : " " ,
49
+ "versus" : " swoole"
27
50
}
28
51
}
29
52
]
Original file line number Diff line number Diff line change
1
+ FROM php:8.0-cli
2
+
3
+ RUN pecl install swoole > /dev/null && \
4
+ docker-php-ext-enable swoole
5
+
6
+ RUN docker-php-ext-install opcache pdo_mysql bcmath > /dev/null
7
+
8
+ RUN apt -yqq update > /dev/null && \
9
+ apt -yqq install git unzip > /dev/null
10
+
11
+ COPY . /one
12
+ COPY php.ini /usr/local/etc/php/
13
+ RUN echo "opcache.enable=1" >> /usr/local/etc/php/php.ini
14
+ RUN echo "opcache.enable_cli=1" >> /usr/local/etc/php/php.ini
15
+ RUN echo "pcre.jit=1" >> /usr/local/etc/php/php.ini
16
+ RUN echo "opcache.jit=1205" >> /usr/local/etc/php/php.ini
17
+ RUN echo "opcache.jit_buffer_size=256M" >> /usr/local/etc/php/php.ini
18
+
19
+ RUN php -v && php -i | grep opcache
20
+
21
+ WORKDIR /one
22
+
23
+ RUN curl -sSL https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
24
+ RUN composer install --no-dev --classmap-authoritative --quiet > /dev/null
25
+ RUN composer dumpautoload -o
26
+
27
+ RUN mkdir -p /one/App/RunCache
28
+ RUN chmod -R 777 /one/App/RunCache
29
+
30
+ EXPOSE 8080
31
+
32
+ CMD php App/swoole_disable_coroutine.php
You can’t perform that action at this time.
0 commit comments