forked from khs1994-docker/lnmp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-workspace.example.yml
98 lines (87 loc) · 2.51 KB
/
docker-workspace.example.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
#
# @link https://www.ruanyifeng.com/blog/2016/07/yaml.html
#
x-common:
&common
# fix me
working_dir: /app
restart: "no"
services:
workspace:
&workspace
image: ${LNMP_DOCKER_IMAGE_PREFIX:-khs1994}/php:${LNMP_PHP_VERSION:-8.3.0}-composer-alpine
networks:
- backend
volumes:
# https://code.visualstudio.com/remote/advancedcontainers/avoid-extension-reinstalls
- vscode-server:/root/.vscode-server
- vscode-server-insiders:/root/.vscode-server-insiders
- vscode-phpls-cache:/root/.phpls
# fix me
# linux/macOS
# - ./app:/app
# fix me 将依赖挂载到数据卷
# - vendor:/app/demo/vendor
- ${APP_ROOT}:/app
# 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
restart: always
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: "${LNMP_DOCKER_IMAGE_PREFIX:-khs1994}/php:${LNMP_PHP_VERSION:-8.3.0}-composer-alpine"
command: [] # install | update
npm:
<< :
- *workspace
- *common
image: node:${LNMP_NODE_VERSION:-20.5.1}-alpine
entrypoint: npm
command: [] # install | ["run","dev"] |
networks:
backend:
volumes:
composer-cache-data:
vscode-server:
vscode-server-insiders:
vscode-phpls-cache:
vendor:
# 或者复用其他数据卷
# external: true
# name: lnmp_laravel_vendor
npm-global-data:
npm-cache-data: