From dc90168bcdbce0a12afe122eca0ae21781dec055 Mon Sep 17 00:00:00 2001 From: NicoVIII Date: Sun, 29 Mar 2026 09:40:10 +0000 Subject: [PATCH 1/2] Add devcontainer --- .devcontainer/devcontainer.json | 51 ++++++++++++++++++++++++++++++++ .devcontainer/docker-compose.yml | 26 ++++++++++++++++ .gitignore | 1 + 3 files changed, 78 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/docker-compose.yml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..941a7d00 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,51 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node +{ + "name": "Node.js", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "dockerComposeFile": "docker-compose.yml", + "service": "app", + "workspaceFolder": "/workspaces/drop", + "runServices": [ "db", "app" ], + "shutdownAction": "stopCompose", + "containerEnv": { + "DATABASE_URL": "postgres://drop:drop@db:5432/drop", + "EXTERNAL_URL": "http://localhost:4000", + "NUXT_PORT": "4000" + }, + + // Features to add to the dev container. More info: https://containers.dev/features. + "features": { + "ghcr.io/devcontainers/features/node:1": { }, + "ghcr.io/devcontainers/features/rust:1": { + "version": "nightly-2026-03-29" + }, + "ghcr.io/devcontainers-extra/features/protoc:1": { } + }, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "git submodule update --init --recursive", + "postStartCommand": "pnpm install && pnpm prisma migrate deploy && cd torrential && cargo build --release && cd ..", + + // Configure tool-specific properties. + "customizations": { + "vscode": { + "extensions": [ + "lokalise.i18n-ally", + "esbenp.prettier-vscode", + "Prisma.prisma", + "bradlc.vscode-tailwindcss", + "Vue.volar", + "arktypeio.arkdark", + "EditorConfig.EditorConfig", + "dbaeumer.vscode-eslint" + ] + } + } + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 00000000..52598027 --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,26 @@ +services: + app: + image: mcr.microsoft.com/devcontainers/base:noble + command: sleep infinity + volumes: + - ..:/workspaces/drop:cached + depends_on: + db: + condition: service_healthy + + db: + image: postgres:14-alpine + environment: + POSTGRES_USER: drop + POSTGRES_PASSWORD: drop + POSTGRES_DB: drop + volumes: + - pgdata:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U drop -d drop"] + interval: 5s + timeout: 5s + retries: 20 + +volumes: + pgdata: diff --git a/.gitignore b/.gitignore index 9cbcd222..1c3cf86b 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ dist # Node dependencies node_modules .yarn +.pnpm-store # Logs logs From 2a4df7e6d89e34f107380a05a1f247991c1724dc Mon Sep 17 00:00:00 2001 From: NicoVIII Date: Sun, 29 Mar 2026 10:42:41 +0000 Subject: [PATCH 2/2] Fix linting --- .devcontainer/devcontainer.json | 49 +++++++++++++++++---------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 941a7d00..10e075af 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,35 +1,12 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the // README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node { - "name": "Node.js", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "dockerComposeFile": "docker-compose.yml", - "service": "app", - "workspaceFolder": "/workspaces/drop", - "runServices": [ "db", "app" ], - "shutdownAction": "stopCompose", "containerEnv": { "DATABASE_URL": "postgres://drop:drop@db:5432/drop", "EXTERNAL_URL": "http://localhost:4000", "NUXT_PORT": "4000" }, - // Features to add to the dev container. More info: https://containers.dev/features. - "features": { - "ghcr.io/devcontainers/features/node:1": { }, - "ghcr.io/devcontainers/features/rust:1": { - "version": "nightly-2026-03-29" - }, - "ghcr.io/devcontainers-extra/features/protoc:1": { } - }, - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "git submodule update --init --recursive", - "postStartCommand": "pnpm install && pnpm prisma migrate deploy && cd torrential && cargo build --release && cd ..", - // Configure tool-specific properties. "customizations": { "vscode": { @@ -44,8 +21,32 @@ "dbaeumer.vscode-eslint" ] } - } + }, // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. // "remoteUser": "root" + + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "dockerComposeFile": "docker-compose.yml", + // Features to add to the dev container. More info: https://containers.dev/features. + "features": { + "ghcr.io/devcontainers-extra/features/protoc:1": {}, + "ghcr.io/devcontainers/features/node:1": {}, + "ghcr.io/devcontainers/features/rust:1": { + "version": "nightly-2026-03-29" + } + }, + + "name": "Node.js", + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "git submodule update --init --recursive", + "postStartCommand": "pnpm install && pnpm prisma migrate deploy && cd torrential && cargo build --release && cd ..", + + "runServices": ["db", "app"], + "service": "app", + "shutdownAction": "stopCompose", + "workspaceFolder": "/workspaces/drop" }