devcontainer with cosmos + qdrant (#3)

This commit is contained in:
Kosta Petan
2023-06-12 11:58:09 +02:00
committed by GitHub
parent 90a527f65f
commit 9f082784c7
6 changed files with 124 additions and 0 deletions

5
.devcontainer/Dockerfile Normal file
View File

@@ -0,0 +1,5 @@
FROM mcr.microsoft.com/devcontainers/dotnet:0-7.0
# Install the xz-utils package
RUN apt-get update && apt-get install -y xz-utils nodejs
RUN curl -fsSL https://aka.ms/install-azd.sh | bash

View File

@@ -0,0 +1,46 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/universal
{
"name": "SK Dev team",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"dockerComposeFile": "docker-compose.yml",
"service": "devcontainer",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"features": {
"ghcr.io/devcontainers/features/azure-cli:1": {},
"ghcr.io/devcontainers/features/common-utils:2": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
"postCreateCommand": "bash .devcontainer/startup.sh",
"hostRequirements": {
"memory": "16gb",
"cpus": 8
},
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// 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": "uname -a",
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
"remoteUser": "root",
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.vscode-node-azure-pack",
"ms-azuretools.vscode-docker",
"ms-dotnettools.csdevkit",
"Azurite.azurite",
"ms-dotnettools.csharp",
"ms-semantic-kernel.semantic-kernel"
]
}
}
}

View File

@@ -0,0 +1,28 @@
version: '3.8'
services:
devcontainer:
build:
context: .
dockerfile: Dockerfile
init: true
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ..:/workspace:cached
# Overrides default command so things don't shut down after the process ends.
command: sleep infinity
network_mode: service:cosmos
depends_on:
- cosmos
cosmos:
image: mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator
mem_limit: "3g"
cpu_count: 2
init: true
restart: unless-stopped
environment:
AZURE_COSMOS_EMULATOR_PARTITION_COUNT: "10"
AZURE_COSMOS_EMULATOR_ENABLE_DATA_PERSISTENCE: "true"
qdrant:
image: qdrant/qdrant
ports:
- 6333:6333

5
.devcontainer/startup.sh Normal file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
curl -k https://localhost:8081/_explorer/emulator.pem > ~/emulatorcert.crt
sudo cp ~/emulatorcert.crt /usr/local/share/ca-certificates/
sudo update-ca-certificates