-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-workspace.yml
100 lines (88 loc) · 2.38 KB
/
docker-workspace.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
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
x-common:
&common
# fix me
working_dir: /app/demo
restart: "no"
services:
workspace:
&workspace
image: khs1994/php:8.3.12-composer-alpine
networks:
- backend
volumes:
- vscode-server:/root/.vscode-server
- vscode-server-insiders:/root/.vscode-server-insiders
- vscode-phpls-cache:/root/.phpls
# fix me
# linux/macOS
- ./:/app/demo
# fix me 将依赖挂载到数据卷
# - vendor:/app/demo/vendor
# - /var/lib/app/demo:/app/demo
# composer
- type: volume
source: composer-cache-data
target: /tmp/composer/cache
- type: bind
source: ./.devcontainer/composer.config.json
target: /tmp/composer/config.json
# - type: bind
# source: ./.devcontainer/composer.auth.json
# target: /tmp/composer/auth.json
# php
- type: bind
source: ./.devcontainer/docker-php.ini
target: /usr/local/etc/php/conf.d/docker-php.ini
- type: bind
source: ./.devcontainer/php-cli.ini
target: /usr/local/etc/php/php-cli.ini
- ./.devcontainer/php-log:/var/log/php
# node
# 如果你修改了 .npmrc 中的路径,请同步更改这里的数据卷映射关系
- type: bind
source: ./.devcontainer/.npmrc
target: /usr/local/etc/npmrc
- npm-global-data:/tmp/node/npm
- npm-cache-data:/tmp/node/.npm
command: /bin/sh -c "while sleep 1000; do :; done"
environment:
APP_ENV: ${APP_ENV:-development}
TZ: Asia/Shanghai
vscode-remote-container-workspace:
<< : *workspace
ports:
# 如果 vsCode 运行在容器中,必须开放 9003 端口供 xdebug 连接
# xdebug port
- 9003:9003
composer:
<< :
- *workspace
- *common
image: "khs1994/php:8.3.12-composer-alpine"
command: [] # install | update
npm:
<< :
- *workspace
- *common
image: node:20.5.1-alpine
entrypoint: npm
command: [] # install | "run","dev" |
networks:
backend:
external: true
name: lnmp_backend
volumes:
composer-cache-data:
external: true
name: lnmp_composer-cache-data
vscode-server:
vscode-server-insiders:
vscode-phpls-cache:
vendor:
# 或者复用其他数据卷
# external: true
# name: lnmp_laravel_vendor
npm-global-data:
npm-cache-data:
external: true
name: lnmp_npm-cache-data