-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
executable file
·117 lines (111 loc) · 3.41 KB
/
docker-compose.yaml
File metadata and controls
executable file
·117 lines (111 loc) · 3.41 KB
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#
# Author: https://github.com/bdbin/ldnmp
# Source: https://github.com/bdbin/ldnmp
#
# License: Apache-2.0 - see https://github.com/bdbin/ldnmp/blob/main/LICENSE.txt
services:
# --- deploy nginx ----
nginx:
image: nginx:1.29.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:
PHP_EXTENSIONS:
dockerfile_inline: |
FROM php:8.5.0-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 set -eux; \
if [ -z $${PHP_EXTENSIONS} ]; then \
for i in $(curl --sSL https://raw.githubusercontent.com/mlocati/docker-php-extension-installer/refs/heads/master/data/supported-extensions | grep $(php -v | awk 'NR==1 {print $2}' | cut -d. -f1,2) | awk '{print $1}'); do \
echo "https://github.com/bdbin/ldnmp install $$i"; \
IPE_PROCESSOR_COUNT=2 install-php-extensions $$i; \
done \
else \
for i in $${PHP_EXTENSIONS}; do \
echo "https://github.com/bdbin/ldnmp install $$i"; \
IPE_PROCESSOR_COUNT=2 install-php-extensions $$i; \
done \
fi; \
platforms:
- "linux/amd64"
- "linux/arm64"
image: bdbin/php:8.5.0-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.5.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:8.4.0
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