fix: fine tune devcontainer (#329)
Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>
This commit is contained in:
parent
1b505d463c
commit
c0d1b3d887
3 changed files with 46 additions and 18 deletions
10
.devcontainer/Dockerfile
Normal file
10
.devcontainer/Dockerfile
Normal file
|
@ -0,0 +1,10 @@
|
|||
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-18
|
||||
|
||||
RUN usermod -l zipline node \
|
||||
&& groupmod -n zipline node \
|
||||
&& usermod -d /home/zipline zipline \
|
||||
&& echo "zipline ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/zipline \
|
||||
&& chmod 0440 /etc/sudoers.d/zipline \
|
||||
&& sudo apt-get update && apt-get install gnupg2 -y
|
||||
|
||||
USER zipline
|
|
@ -2,12 +2,15 @@
|
|||
"name": "Zipline Codespace",
|
||||
"dockerComposeFile": "docker-compose.yml",
|
||||
"service": "app",
|
||||
"workspaceFolder": "/workspace",
|
||||
"forwardPorts": [3000, 5432],
|
||||
"workspaceFolder": "/zipline",
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/common-utils:2": {},
|
||||
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
|
||||
"ghcr.io/devcontainers/features/node:1": {}
|
||||
"ghcr.io/devcontainers/features/common-utils:2": {
|
||||
"username": "zipline"
|
||||
},
|
||||
"ghcr.io/devcontainers/features/docker-in-docker:1": {
|
||||
"dockerDashComposeVersion": "v2",
|
||||
"installDockerBuildx": true
|
||||
}
|
||||
},
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
|
@ -20,12 +23,23 @@
|
|||
},
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.formatOnSave": true,
|
||||
"files.autoSave": "afterDelay"
|
||||
"files.autoSave": "afterDelay",
|
||||
"terminal.integrated.persistentSessionReviveProcess": "never",
|
||||
"terminal.integrated.defaultProfile.linux": "zsh",
|
||||
"terminal.integrated.profiles.linux": {
|
||||
"zsh": {
|
||||
"path": "/bin/zsh",
|
||||
"env": {
|
||||
"ZSH_THEME": "devcontainers"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"extensions": ["prisma.prisma", "esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
|
||||
}
|
||||
},
|
||||
"remoteUser": "zipline",
|
||||
"updateRemoteUserUID": true,
|
||||
"remoteEnv": {
|
||||
"CORE_DATABASE_URL": "postgres://postgres:postgres@localhost/zip10"
|
||||
},
|
||||
|
@ -37,5 +51,6 @@
|
|||
"5432": {
|
||||
"label": "Postgres"
|
||||
}
|
||||
}
|
||||
},
|
||||
"postCreateCommand": "sudo chown -R zipline:zipline /zipline && yarn install"
|
||||
}
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
version: '3.8'
|
||||
services:
|
||||
app:
|
||||
image: mcr.microsoft.com/vscode/devcontainers/javascript-node:0-18
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: Dockerfile
|
||||
volumes:
|
||||
- ..:/workspace:cached
|
||||
network_mode: service:db
|
||||
- ../:/zipline:cached
|
||||
- uploads:/zipline/uploads
|
||||
- node_modules:/zipline/node_modules
|
||||
command: sleep infinity
|
||||
user: zipline
|
||||
db:
|
||||
image: postgres:latest
|
||||
restart: unless-stopped
|
||||
|
@ -19,4 +21,5 @@ services:
|
|||
|
||||
volumes:
|
||||
pg_data:
|
||||
|
||||
uploads:
|
||||
node_modules:
|
Loading…
Reference in a new issue