-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
executable file
·103 lines (98 loc) · 4.29 KB
/
docker-compose.yaml
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
services:
# --- deploy nginx ----
nginx:
image: nginx:1.27.3-alpine
container_name: nginx
restart: always
ports:
- "8084:80"
- "8085:443"
environment:
- TZ=Asia/Shanghai
volumes:
- ./apps/nginx/conf.d:/etc/nginx/conf.d:rw
- ./apps/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./apps/nginx/fastcgi.conf:/etc/nginx/fastcgi.conf:ro
- ./apps/nginx/logs:/var/log/nginx:rw
- ./apps/nginx/ssl:/etc/nginx/ssl
- ./web:/usr/share/nginx/html
networks:
- bdbin
# --- deploy php ----
php:
build:
context: .
args:
# for php 8.4.x
PHP_EXTENSIONS: amqp apcu ast bcmath bitset brotli bz2 calendar csv dba ddtrace decimal ds enchant ev event excimer exif ffi ftp gd geos geospatial gettext gmagick gmp gnupg grpc http igbinary imap inotify intl ion json_post jsonpath ldap luasandbox lzf mailparse maxminddb md4c memcache memcached memprof mongodb msgpack mysqli oauth oci8 odbc opcache opentelemetry parallel parle pcntl pcov pdo_dblib pdo_firebird pdo_mysql pdo_oci pdo_odbc pdo_pgsql pdo_sqlsrv pgsql php_trie phpy pkcs11 pq protobuf pspell psr raphf rdkafka redis relay saxon seasclick shmop simdjson smbclient snappy snmp snuffleupagus soap sockets spx sqlsrv ssh2 stomp swoole sync sysvmsg sysvsem sysvshm tideways tidy timezonedb uploadprogress uuid uv vips wikidiff2 xdebug xdiff xhprof xlswriter xmldiff xmlrpc xpass xsl yac yaml yar zephir_parser zip zmq zstd
# for php 8.3.x
# PHP_EXTENSIONS: amqp apcu ast bcmath bitset blackfire bz2 calendar csv dba ddtrace decimal ds enchant ev event excimer exif ffi ftp gd gearman geos geospatial gettext gmagick gmp gnupg grpc http igbinary imap inotify intl ion json_post jsonpath ldap luasandbox lzf mailparse maxminddb mcrypt memcache memcached mongodb msgpack mysqli newrelic oauth oci8 odbc opcache parle pcntl pcov pdo_dblib pdo_firebird pdo_mysql pdo_oci pdo_odbc pdo_pgsql pdo_sqlsrv pgsql php_trie phpy pkcs11 pq protobuf pspell raphf rdkafka redis relay seasclick seaslog shmop smbclient snappy snmp snuffleupagus soap sockets solr sourceguardian spx ssh2 stomp swoole sync sysvmsg sysvsem sysvshm tideways tidy timezonedb uploadprogress uuid uv vld xdebug xdiff xhprof xlswriter xmldiff xmlrpc xsl yac yaml yar zephir_parser zip zmq zstd
dockerfile_inline: |
FROM php:8.4.3-fpm-alpine
LABEL maintainer="LDNMP Docker Maintainers <https://github.com/bdbin/ldnmp>"
RUN curl -sSLf -o /usr/local/bin/install-php-extensions https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions \
&& chmod +x /usr/local/bin/install-php-extensions \
&& apk update \
&& apk --no-cache add tzdata \
&& cp "/usr/share/zoneinfo/Asia/Shanghai" /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone
ARG PHP_EXTENSIONS
RUN for i in $${PHP_EXTENSIONS}; do echo "LDNMP install $$i"; install-php-extensions $$i; done
platforms:
- "linux/amd64"
- "linux/arm64"
image: bdbin/php:8.4.3-fpm-alpine
container_name: php
restart: always
ports:
- 9000:9000
volumes:
- ./apps/php/etc/php.ini:/usr/local/etc/php/php.ini
- ./apps/php/etc/php-fpm.conf:/usr/local/etc/php-fpm.d/www.conf:rw
- ./apps/php/logs:/var/log/php
- ./web:/usr/share/nginx/html
networks:
- bdbin
# --- deploy mysql ----
mysql:
image: mysql:9.2.0
container_name: mysql
restart: always
ports:
- '3307:3306'
environment:
- MYSQL_ROOT_PASSWORD=gYFMzPu85nWnYxebBGnxvf
- TZ=Asia/Shanghai
volumes:
- ./apps/mysql/conf/my.cnf:/etc/my.cnf:ro
- ./apps/mysql/data:/var/lib/mysql
- ./apps/mysql/logs:/var/log/mysql
networks:
- bdbin
# --- deploy adminer ---
adminer:
image: adminer
container_name: adminer
restart: always
ports:
- 8086:8080
networks:
- bdbin
# --- deploy redis ---
redis:
image: redis:7.4.2
container_name: redis
restart: always
ports:
- "6379:6379"
environment:
- TZ=Asia/Shanghai
volumes:
- ./apps/redis/conf/redis.conf:/etc/redis.conf:ro
- ./apps/redis/data:/data/:rw
entrypoint: ["redis-server", "/etc/redis.conf"]
networks:
- bdbin
networks:
bdbin:
driver: bridge