dev container修正
This commit is contained in:
6
.devcontainer/external/devcontainer.json
vendored
6
.devcontainer/external/devcontainer.json
vendored
@@ -27,5 +27,9 @@
|
||||
"SPRING_PROFILES_ACTIVE": "dev",
|
||||
"K12STUDY_DEV_MODE": "external"
|
||||
},
|
||||
"postCreateCommand": "cd /workspaces/K12study"
|
||||
|
||||
"remoteUser": "codespace",
|
||||
"updateRemoteUserUID": true,
|
||||
|
||||
"postCreateCommand": "sudo chown -R codespace:codespace /pnpm-store /workspaces/K12study/frontend/node_modules"
|
||||
}
|
||||
|
||||
12
.devcontainer/external/docker-compose.yml
vendored
12
.devcontainer/external/docker-compose.yml
vendored
@@ -3,9 +3,17 @@ services:
|
||||
image: mcr.microsoft.com/devcontainers/universal:2
|
||||
volumes:
|
||||
- ../../:/workspaces/K12study:cached
|
||||
- frontend-node-modules:/workspaces/K12study/frontend/node_modules
|
||||
- pnpm-store:/pnpm-store
|
||||
working_dir: /workspaces/K12study
|
||||
command: sleep infinity
|
||||
user: 1000:1000 # 👈 强制权限,最关键
|
||||
environment:
|
||||
NPM_CONFIG_USER: 1000
|
||||
PNPM_HOME: /pnpm-store
|
||||
PNPM_STORE_DIR: /pnpm-store
|
||||
|
||||
# 你原来的所有环境变量...
|
||||
K12STUDY_DB_HOST: ${K12STUDY_DB_HOST:-host.docker.internal}
|
||||
K12STUDY_DB_PORT: ${K12STUDY_DB_PORT:-5432}
|
||||
K12STUDY_DB_NAME: ${K12STUDY_DB_NAME:-k12study}
|
||||
@@ -30,3 +38,7 @@ services:
|
||||
PYTHONUNBUFFERED: "1"
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
|
||||
volumes:
|
||||
frontend-node-modules:
|
||||
pnpm-store:
|
||||
Reference in New Issue
Block a user