commit d2d1c1bfb6159806f3f7afba1e314c18fa4d571c
parent a343e93c403f4739152c4fb442e3441b1eeac226
Author: Yuukin256 <Yuukin256@gmail.com>
Date: Sun, 15 May 2022 15:58:54 +0900
devcontainer導入
Diffstat:
4 files changed, 72 insertions(+), 1 deletion(-)
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
@@ -0,0 +1,14 @@
+# [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>"
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
@@ -0,0 +1,34 @@
+// 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.234.0/containers/javascript-node-postgres
+// Update the VARIANT arg in docker-compose.yml to pick a Node.js version
+{
+ "name": "Node.js & PostgreSQL",
+ "dockerComposeFile": "docker-compose.yml",
+ "service": "app",
+ "workspaceFolder": "/workspace",
+
+ // Set *default* container specific settings.json values on container create.
+ "settings": {},
+
+ // Add the IDs of extensions you want installed when the container is created.
+ "extensions": [
+ "dbaeumer.vscode-eslint",
+ "esbenp.prettier-vscode",
+ "eg2.vscode-npm-script",
+ "editorconfig.editorconfig",
+ "orta.vscode-jest"
+ ],
+
+ // 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": [3000, 5432],
+
+ // Use 'postCreateCommand' to run commands after the container is created.
+ // "postCreateCommand": "yarn install",
+
+ // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
+ "remoteUser": "node",
+ "features": {
+ "git": "latest"
+ }
+}
diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml
@@ -0,0 +1,24 @@
+version: '3.8'
+
+services:
+ app:
+ build:
+ context: .
+ dockerfile: Dockerfile
+ args:
+ # Update 'VARIANT' to pick an LTS version of Node.js: 18, 16, 14.
+ # Append -bullseye or -buster to pin to an OS version.
+ # Use -bullseye variants on local arm64/Apple Silicon.
+ VARIANT: 16-bullseye
+
+ volumes:
+ - ..:/workspace:cached
+
+ # Overrides default command so things don't shut down after the process ends.
+ command: sleep infinity
+
+ # Uncomment the next line to use a non-root user for all processes.
+ # user: node
+
+ # Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
+ # (Adding the "ports" property to this file will not forward from a Codespace.)
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
@@ -4,6 +4,5 @@
"esbenp.prettier-vscode",
"eg2.vscode-npm-script",
"editorconfig.editorconfig",
- "orta.vscode-jest"
]
}