-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
56 lines (53 loc) · 1.7 KB
/
docker-compose.yml
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
version: '3.8'
services:
nginx:
image: nginx:1.21.6
restart: always
depends_on:
- app
ports:
- 8080:80 # 80:80 if production
# - 443:443 # production only
volumes:
# configuration files & directories
- ./_server/etc/nginx/conf.d:/etc/nginx/conf.d
- ./_server/etc/nginx/nginx.conf:/etc/nginx/nginx.conf
- ./_server/var/log/nginx:/var/log/nginx
# source code
- ./l9app:/var/www/html
# runtime php-fpm socket
- ./_server/var/run/php:/var/run/php
app:
image: php-mysql:8.1.4-fpm
build:
context: .
dockerfile: ./php-mysql.Dockerfile
depends_on:
- db
entrypoint:
- php-fpm
- -n # --no-php-ini: No php.ini file will be used: https://linux.die.net/man/8/php-fpm
- -c # --php-ini: Look for php.ini file in the directory path or use the specified file: https://linux.die.net/man/8/php-fpm
- /etc/php/php.ini
- -y # --fpm-config: Specify alternative path to FastCGI process manager configuration file: https://linux.die.net/man/8/php-fpm
- /etc/php/php-fpm.conf
volumes:
# configuration files & directory
- ./_server/etc/php:/etc/php
# source code
- ./l9app:/var/www/html
# runtime php-fpm socket
- ./_server/var/run/php:/var/run/php
links:
- db
db:
# quick solution to run mysql on Mac M1
platform: linux/x86_64 # https://stackoverflow.com/questions/65456814/docker-apple-silicon-m1-preview-mysql-no-matching-manifest-for-linux-arm64-v8
image: mysql:8.0.28
restart: always
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: 1
ports:
- 33060:3306
volumes:
- ./_server/var/lib/mysql:/var/lib/mysql