diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..126bdf24 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1 @@ +FROM mcr.microsoft.com/devcontainers/base:dev-ubuntu-24.04 \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 854f6bdb..af801cfc 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,26 +1,28 @@ { "name": "Chat Game", - "image": "mcr.microsoft.com/devcontainers/typescript-node:22", - "workspaceFolder": "/workspaces/chat-game/${localWorkspaceFolderBasename}", - - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "npm i -g pnpm@9.10.0 && pnpm i", - - // Configure tool-specific properties. + "dockerComposeFile": "docker-compose.yaml", + "service": "app", + "workspaceFolder": "/workspaces/space/${localWorkspaceFolderBasename}", + "updateContentCommand": "npm i -g turbo@latest && pnpm i", "customizations": { - // Configure properties specific to VS Code. "vscode": { - // Add the IDs of extensions you want installed when the container is created. "extensions": [ + "bradlc.vscode-tailwindcss", "dbaeumer.vscode-eslint", "Vue.volar", "ms-azuretools.vscode-docker", "Codeium.codeium", - "Vercel.turbo-vsc" + "Vercel.turbo-vsc", + "Prisma.prisma" ] } + }, + "features": { + "ghcr.io/devcontainers/features/node:1": { + "nodeGypDependencies": true, + "version": "lts", + "pnpmVersion": "latest", + "nvmVersion": "latest" + } } } diff --git a/.devcontainer/docker-compose.yaml b/.devcontainer/docker-compose.yaml new file mode 100644 index 00000000..6ca76bce --- /dev/null +++ b/.devcontainer/docker-compose.yaml @@ -0,0 +1,24 @@ +services: + app: + build: + context: .. + dockerfile: .devcontainer/Dockerfile + + volumes: + - ../..:/workspaces:cached + + # Overrides default command so things don't shut down after the process ends. + command: sleep infinity + + db: + image: postgres:17 + restart: unless-stopped + volumes: + - postgres-data:/var/lib/postgresql/data + environment: + POSTGRES_USER: postgres + POSTGRES_DB: postgres + POSTGRES_PASSWORD: postgres + +volumes: + postgres-data: \ No newline at end of file