-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
executable file
·45 lines (37 loc) · 1.42 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# @description php image base on the php-swoole
#
# Some Information
# ------------------------------------------------------------------------------------
# @link https://hub.docker.com/_/phpswoole/ swoole image
# @link https://hub.docker.com/_/php/ php image
# ------------------------------------------------------------------------------------
# @build-example docker build . -f Dockerfile -t agarwood/oauth:2.0
#
FROM phpswoole/swoole:4.8.7-php8.1
LABEL maintainer="[email protected]>" version="2.0"
# default TIMEZONE = Asia/Shanghai
ENV TIMEZONE="Asia/Shanghai"
# To install the Redis extension.
RUN set -ex \
&& apt-get update && apt-get install -y \
&& apt-get install git -y \
&& pecl update-channels \
&& pecl install redis-stable \
&& docker-php-ext-enable redis \
# To install the mongo extension.
&& pecl install mongodb-stable \
&& docker-php-ext-enable mongodb \
# Install PHP extensions
&& docker-php-ext-install \
bcmath mysqli pdo_mysql \
# Clean apt cache
&& rm -rf /var/lib/apt/lists/*
# Timezone
RUN cp /usr/share/zoneinfo/${TIMEZONE} /etc/localtime \
&& echo "${TIMEZONE}" > /etc/timezone \
&& echo "[Date]\date.timezone=${TIMEZONE}" > /usr/local/etc/php/conf.d/timezone.ini
# Install composer deps
ADD . /var/www/agarwood
WORKDIR /var/www/agarwood
EXPOSE 18306 18307 18308
CMD ["php", "/var/www/agarwood/bin/agarwood", "http:start"]