From 908f2990e011135009005cca6db9521f39234d3c Mon Sep 17 00:00:00 2001 From: Bogdan Bogdanov Date: Thu, 6 May 2021 19:49:36 +0000 Subject: [PATCH] Add .devcontainer --- .devcontainer/Dockerfile | 17 +++++++++++++ .devcontainer/devcontainer.json | 41 ++++++++++++++++++++++++++++++++ .devcontainer/docker-compose.yml | 41 ++++++++++++++++++++++++++++++++ .gitignore | 3 +++ 4 files changed, 102 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/docker-compose.yml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..9b2dc97 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,17 @@ +# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.177.0/containers/typescript-node/.devcontainer/base.Dockerfile + +# [Choice] Node.js version: 16, 14, 12 +ARG VARIANT="16-buster" +FROM mcr.microsoft.com/vscode/devcontainers/typescript-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 + +# [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 packages +# RUN su node -c "npm install -g " + diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..c747fe6 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,41 @@ +// 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.177.0/containers/typescript-node +{ + "name": "qBittorrent", + + // Update the 'dockerComposeFile' list if you have more compose files or use different names. + "dockerComposeFile": "docker-compose.yml", + + // The 'service' property is the name of the service for the container that VS Code should + // use. Update this value and .devcontainer/docker-compose.yml to the real service name. + "service": "app", + + // The optional 'workspaceFolder' property is the path VS Code should open by default when + // connected. This is typically a volume mount in .devcontainer/docker-compose.yml + "workspaceFolder": "/workspace", + + // Set *default* container specific settings.json values on container create. + "settings": { + "terminal.integrated.defaultProfile.linux": "/bin/bash" + }, + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "dbaeumer.vscode-eslint", + "jcbuisson.vue", + "eamodio.gitlens", + "donjayamanne.githistory" + ], + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + "forwardPorts": [ + 8000, + 8080 + ], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "yarn install", + + // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "node" +} \ No newline at end of file diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 0000000..f0edc86 --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,41 @@ +version: '3' + +services: + qb.test: + image: linuxserver/qbittorrent + container_name: qbittorrent + environment: + - PUID=1000 + - PGID=1000 + - UMASK_SET=022 + - WEBUI_PORT=8080 + ports: + - 8080:8080 + volumes: + - ./qbittorrent:/config + - ./downloads:/downloads + restart: unless-stopped + app: + container_name: qb-web + depends_on: + - qb.test + # Using a Dockerfile is optional, but included for completeness. + build: + context: . + dockerfile: Dockerfile + # [Optional] You can use build args to set options. e.g. 'VARIANT' below affects the image in the Dockerfile + args: + VARIANT: 16-buster + + volumes: + # This is where VS Code should expect to find your project's source code and the value of "workspaceFolder" in .devcontainer/devcontainer.json + - ..:/workspace:cached + + # Uncomment the next line to use Docker from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker-compose for details. + # - /var/run/docker.sock:/var/run/docker.sock + + # Overrides default command so things don't shut down after the process ends. + command: /bin/sh -c "while sleep 1000; do :; done" + + # Runs app on the same network as the service container, allows "forwardPorts" in devcontainer.json function. + network_mode: service:qb.test \ No newline at end of file diff --git a/.gitignore b/.gitignore index 7983440..03caf28 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,6 @@ yarn-error.log* *.njsproj *.sln *.sw? + +/.devcontainer/downloads +/.devcontainer/qbittorrent \ No newline at end of file