-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
105 lines (103 loc) · 3.68 KB
/
Copy pathdocker-compose.yml
File metadata and controls
105 lines (103 loc) · 3.68 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
version: "3"
services:
webserver:
links:
- nodejs-app
build:
context: ./bin/${PHPVERSION}
container_name: '${COMPOSE_PROJECT_NAME}-${PHPVERSION}'
restart: 'always'
ports:
- "${HOST_MACHINE_UNSECURE_HOST_PORT}:80"
- "${HOST_MACHINE_SECURE_HOST_PORT}:443"
volumes:
- ${DOCUMENT_ROOT-./www}:/var/www/html
- ${PHP_INI-./config/php/php.ini}:/usr/local/etc/php/php.ini
- ${VHOSTS_DIR-./config/vhosts}:/etc/apache2/sites-enabled
- ${LOG_DIR-./logs/apache2}:/var/log/apache2
- /etc/letsencrypt/live/www.chinococo.tw/cert.pem:/etc/apache2/ssl/cert.pem
- /etc/letsencrypt/live/www.chinococo.tw/chain.pem:/etc/apache2/ssl/chain.pem
- /etc/letsencrypt/live/www.chinococo.tw/fullchain.pem:/etc/apache2/ssl/fullchain.pem
- /etc/letsencrypt/live/www.chinococo.tw/privkey.pem:/etc/apache2/ssl/privkey.pem
environment:
PMA_PORT: ${HOST_MACHINE_PMA_PORT}
#command: ["sh", "-c", "ngrok authtoken $NGROK_AUTH_TOKEN && ngrok http 80 && apache2-foreground"]
database:
build:
context: "./bin/${DATABASE}"
container_name: '${COMPOSE_PROJECT_NAME}-database'
# network_mode: "host" # 使用Host Network
restart: 'always'
ports:
- "${HOST_MACHINE_MYSQL_PORT}:3306"
volumes:
- ./sqls:/docker-entrypoint-initdb.d
- ${MYSQL_LOG_DIR-./logs/mysql}:/var/log/mysql
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: '${COMPOSE_PROJECT_NAME}-phpmyadmin'
links:
- database
environment:
PMA_HOST: database
PMA_PORT: 3306
PMA_USER: ${MYSQL_USER}
PMA_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
# command: ["sh", "-c", "ngrok http 80 && phpmyadmin"]
ports:
- '${HOST_MACHINE_PMA_PORT}:80'
volumes:
- /sessions
- ${PHP_INI-./config/php/php.ini}:/usr/local/etc/php/conf.d/php-phpmyadmin.ini
#redis:
# container_name: '${COMPOSE_PROJECT_NAME}-redis'
# network_mode: "host" # 使用Host Network
# image: redis:latest
# ports:
# - "${HOST_MACHINE_REDIS_PORT}:6379"
python:
build: ./python
links:
- nodejs-app
working_dir: /opt/apps/test
container_name: '${COMPOSE_PROJECT_NAME}-python'
volumes:
- ./python/result:/opt/apps/test
swagger-editor:
image: swaggerapi/swagger-editor
container_name: "${COMPOSE_PROJECT_NAME}-swagger-editor"
ports:
- "${HOST_MACHINE_SWAGGER_EDITOR_EDITOR}:8080"
swagger-ui:
image: swaggerapi/swagger-ui
container_name: "${COMPOSE_PROJECT_NAME}-swagger-ui"
ports:
- "${HOST_MACHINE_SWAGGER_EDITOR_UI}:8080"
react-app:
# network_mode: "host" # 使用Host Network
container_name: '${COMPOSE_PROJECT_NAME}-react'
build:
context: ./react/
ports:
- "${HOST_MACHINE_REACT}:80"
- "3001:81"
nodejs-app:
links:
- database
build: ./nodejs/ # 使用當前目錄的 Dockerfile 進行構建
#network_mode: "host" # 使用Host Network
volumes:
- /etc/letsencrypt/live/www.chinococo.tw/cert.pem:/usr/src/app/cert.pem
- /etc/letsencrypt/live/www.chinococo.tw/chain.pem:/usr/src/app/chain.pem
- /etc/letsencrypt/live/www.chinococo.tw/fullchain.pem:/usr/src/app/fullchain.pem
- /etc/letsencrypt/live/www.chinococo.tw/privkey.pem:/usr/src/app/privkey.pem
ports:
- "${HOST_MACHINE_Nodejs}:5000" # 映射容器的 3000 埠到主機的 3000 埠