auto copy ormconfig in docker devcontainer

This commit is contained in:
2023-01-08 19:56:32 +01:00
parent 31131393fb
commit e8dd71dbc8

View File

@@ -1,25 +1,20 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/javascript-node-postgres // https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/javascript-node-postgres
// Update the VARIANT arg in docker-compose.yml to pick a Node.js version: 10, 12, 14 // Update the VARIANT arg in docker-compose.yml to pick a Node.js version: 10, 12, 14
{ {
"name": "DevEnv", "name": "DevEnv",
"dockerComposeFile": "docker-compose.yml", "dockerComposeFile": "docker-compose.yml",
"service": "app", "service": "app",
"workspaceFolder": "/workspace", "workspaceFolder": "/workspace",
// Set *default* container specific settings.json values on container create. // Set *default* container specific settings.json values on container create.
"settings": { "settings": {},
}, // Add the IDs of extensions you want installed when the container is created.
// Add the IDs of extensions you want installed when the container is created. "extensions": ["dbaeumer.vscode-eslint"],
"extensions": [ // Use 'forwardPorts' to make a list of ports inside the container available locally.
"dbaeumer.vscode-eslint" "forwardPorts": [1234, 3000],
], // Use 'postCreateCommand' to run commands after the container is created.
// Use 'forwardPorts' to make a list of ports inside the container available locally. // "postCreateCommand": "npm config set unsafe-perm=true && npm i && cd frontend && npm i",
"forwardPorts": [ // Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
1234, "remoteUser": "node",
3000 "postCreateCommand": "cd /workspace; if [ ! -f ormconfig.json ]; then cp ormconfig.dockerdevexample.json ormconfig.json; fi; if [ ! -f ormconfig.test.json ]; then cp ormconfig.dockerdevexample.test.json ormconfig.test.json; fi;"
], }
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "npm config set unsafe-perm=true && npm i && cd frontend && npm i",
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node"
}