Skip to content

Commit

Permalink
fixes to devcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
Charlie ⚡ committed Oct 16, 2022
1 parent f33fc3a commit 32591df
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 33 deletions.
12 changes: 1 addition & 11 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster
ARG VARIANT=16-bullseye
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

# [Optional] Uncomment if you want to install an additional version of node using nvm
# ARG EXTRA_NODE_VERSION=10
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"

# [Optional] Uncomment if you want to install more global node modules
# RUN su node -c "npm install -g <your-package-list-here>"
ENV DATABASE_URL=postgresql:https://postgres:postgres@localhost:5432/reubin
33 changes: 11 additions & 22 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
{
"name": "Node.js & PostgreSQL",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspace",

// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// This can be used to network with other containers or with the host.
"forwardPorts": [5432],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "npm install",
"containerEnv": {
"DATABASE_URL": "postgresql:https://postgres:[email protected]:5432/reubin"
}

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "node"
"name": "Node.js & PostgreSQL",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspace",
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// This can be used to network with other containers or with the host.
"forwardPorts": [5432],
"postCreateCommand": ["npm install", "npm run db", "npm run seed"]

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "node"
}

0 comments on commit 32591df

Please sign in to comment.