Skip to content

Commit 49cfb00

Browse files
committed
Feat: docker php 8
1 parent bf28e0c commit 49cfb00

3 files changed

Lines changed: 23 additions & 15 deletions

File tree

Dockerfile

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,31 @@
1-
FROM php:7.4-cli
2-
3-
COPY . /app
4-
WORKDIR /app
1+
FROM php:8.0-cli
52

63
RUN apt-get update \
7-
&& cp -a docker/php/conf.d/. "$PHP_INI_DIR/conf.d/" \
8-
&& apt-get install git zip -y \
9-
&& PHP_OPENSSL=yes pecl install swoole \
10-
&& docker-php-ext-enable swoole \
4+
&& apt-get install git zip libzip-dev libssl-dev -y \
5+
# Install additional extension \
6+
&& docker-php-ext-install -j$(nproc) sockets zip \
7+
&& mkdir -p /usr/src/php/ext/ && cd /usr/src/php/ext/ \
8+
&& pecl bundle swoole \
9+
&& docker-php-ext-configure swoole --enable-sockets=yes --enable-openssl=yes \
10+
&& docker-php-ext-install -j$(nproc) swoole \
11+
1112
&& docker-php-source delete \
1213
&& apt-get autoremove --purge -y && apt-get autoclean -y && apt-get clean -y \
13-
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
14-
&& composer install -o --no-dev
14+
&& rm -rf /usr/src \
15+
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
1516

16-
VOLUME ["/app/volume", "/app/log"]
17+
COPY . /app
18+
WORKDIR /app
19+
20+
RUN cp -a docker/php/conf.d/. "$PHP_INI_DIR/conf.d/" \
21+
&& composer install -o --no-dev && composer clear
1722

1823
#Creating symlink to save .env in volume
19-
RUN touch '/app/volume/.env' && \
20-
ln -s '/app/volume/.env' '/app/.env'
24+
RUN mkdir /app/volume/ && \
25+
touch '/app/volume/.env.docker' && \
26+
ln -s '/app/volume/.env.docker' '/app/.env.docker'
27+
28+
VOLUME ["/app/volume", "/app/log", "/app/cache"]
2129

2230
EXPOSE 9504
2331

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "MIT",
77
"keywords": ["telegram", "mtproto", "protocol", "client", "PHP", "swoole", "async", "daemon", "coroutine", "parser", "micro-service", "RSS"],
88
"require": {
9-
"php": ">=7.4",
9+
"php": "^7.4|^8.0",
1010
"vlucas/phpdotenv": "^4",
1111
"ext-json": "*",
1212
"ext-dom": "*",

docker/php/conf.d/opcache.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ opcache.validate_timestamps=1
88
opcache.revalidate_freq=0
99
opcache.huge_code_pages=1
1010
opcache.jit_buffer_size=32M
11-
opcache.jit=1235
11+
opcache.jit=1205

0 commit comments

Comments
 (0)