v0.1 init devcontainer

This commit is contained in:
bossanyit 2024-05-07 13:30:15 +02:00
commit db066484e7
55 changed files with 162 additions and 0 deletions

2
.devcontainer/.env Normal file
View File

@ -0,0 +1,2 @@
GIT_USERNAME=aitrainerdev
GIT_PASSWORD=eztjoljegyezdmeg1972ben

40
.devcontainer/Dockerfile Normal file
View File

@ -0,0 +1,40 @@
FROM node:22.1-bullseye
# Install git and other dependencies
RUN apt-get update && apt-get install -y bash build-essential git zsh \
&& rm -rf /var/lib/apt/lists/*
# Install Oh My Zsh
RUN bash -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" && \
sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="agnoster"/' ~/.zshrc
# Optional: Set zsh as the default shell for the root user
RUN chsh -s $(which zsh)
# Clone your Next.js application
ARG GIT_USERNAME
ARG GIT_PASSWORD
RUN git clone https://${GIT_USERNAME}:${GIT_PASSWORD}@git.workouttest.org/bossanyit/voxadata_app /app/voxadata_app
RUN npm install -g corepack
# Install and use yarn 4.x
RUN corepack enable && corepack prepare yarn@4.1.0 --activate
# Set the working directory to /app/voxadata_app
WORKDIR /app/voxadata_app
RUN ls -la
# Copies package.json, yarn.lock and other yarn files to Docker environment
#COPY package.json ./.yarn/releases/yarn-4.1.0.cjs ./
# Check Yarn configuration and install dependencies
RUN yarn config set cacheFolder .yarn/cache && yarn install
# Expose port 3000
EXPOSE 3000
# Run the app when the container launches
CMD ["tail", "-f", "/dev/null"]

View File

@ -0,0 +1,31 @@
// 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-mongo
{
"name": "Node.js & Mongo DB",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"mongodb.mongodb-vscode"
]
}
}
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [3000, 27017],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}

View File

@ -0,0 +1,37 @@
version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile
args:
GIT_USERNAME: ${GIT_USERNAME}
GIT_PASSWORD: ${GIT_PASSWORD}
VARIANT: "22.1"
REPO_URL: "https://registry.workouttest.org/voxadata_app"
volumes:
- ..:/workspaces/voxadata_app # Adjust according to your workspace needs
ports:
- "3000:3000"
environment:
- MONGODB_URI=mongodb://mongodb:27017/voxadata
networks:
- app-network
mongodb:
image: mongo:7-jammy
volumes:
- dbdata:/data/db
- /Users/tiborbossanyi/Development/projects/voxadata/voxadata_dev_container/.devcontainer/initdb:/docker-entrypoint-initdb.d
ports:
- "27117:27017"
networks:
- app-network
volumes:
dbdata:
networks:
app-network:
driver: bridge

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"c51d38a2401c4cc4a071f338b8bd1a2a","collectionName":"auth_sessions","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"9e25eb4295c64aabb357a6346e2d60eb","collectionName":"auth_users","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"6ca0e36ee7474efbaf1b1506d7319f89","collectionName":"auth_verification_tokens","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"6791d4f3bf194ee093cc26b82581858e","collectionName":"chat_history","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"2db37bd041f347d58df385bc3ac6c637","collectionName":"chatbots","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"1016ef88a51a42349b9807e630a5f052","collectionName":"configuration","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"fd17fc09b5964e9fa65b51a5830a22a8","collectionName":"conversation","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"92729e513301451ba079302a6ffe5ed9","collectionName":"conversation_log","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"7bddefd7204441c980ccd5054dba99b0","collectionName":"cron","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"},{"v":{"$numberInt":"2"},"key":{"_fts":"text","_ftsx":{"$numberInt":"1"}},"name":"email_text","weights":{"email":{"$numberInt":"1"}},"default_language":"english","language_override":"language","textIndexVersion":{"$numberInt":"3"}}],"uuid":"cb332f2ce86a494e82f72d5b9f065130","collectionName":"customer","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"a72574da30bf4e1ba7d4436ac6e4b22d","collectionName":"document","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"},{"v":{"$numberInt":"2"},"key":{"_fts":"text","_ftsx":{"$numberInt":"1"}},"name":"text_key_text","weights":{"text_key":{"$numberInt":"1"}},"default_language":"english","language_override":"language","textIndexVersion":{"$numberInt":"3"}}],"uuid":"93ecfe1c3ef542b18c611f511c79af92","collectionName":"document_node","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"07142de42c10459d92cd286022ff245b","collectionName":"document_node_fusion","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"288231cd881244a7943406ce8e06b10c","collectionName":"document_node_media","type":"collection"}

View File

@ -0,0 +1,27 @@
#!/bin/bash
set -e
# MongoDB host and port
MONGO_HOST="localhost"
MONGO_PORT="27017"
# Database name
DB_NAME="voxadata"
# Wait for MongoDB to boot
echo "Waiting for MongoDB to start..."
until mongosh --host $MONGO_HOST --port $MONGO_PORT --eval "print(\"waited for connection\")"
do
sleep 1
done
echo "MongoDB started"
echo "Creating $DB_NAME database and importing BSON files..."
# Loop through all BSON files in the directory and import them
for bson_file in /docker-entrypoint-initdb.d/*.bson; do
echo "Importing $bson_file into $DB_NAME..."
mongorestore --host $MONGO_HOST --port $MONGO_PORT --db $DB_NAME --drop --verbose "$bson_file"
done
echo "Database $DB_NAME setup completed."

View File

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"249ee9213eb949a98abe7e6c1d7f77f9","collectionName":"membership","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"de6cf044c17843689792b004e5f71786","collectionName":"models","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"f785b61c44f149f4993cca6b07e2fb8a","collectionName":"negative_answer","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"27908e427f7f43218e8428bfe64d6e6e","collectionName":"perfect_answer","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"27b5c932cf56485e8ac94588c25407a9","collectionName":"product","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"7b683dc893ba494da2d10142caf3744f","collectionName":"prompt_shot","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"80bbf329c56142f9b396bd4bd9e432ce","collectionName":"prompt_tuning","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"f94e1bc108204916b435e9e106dd516a","collectionName":"scratchpad","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"0bf4b1a2b409400584dfabcaefc8a830","collectionName":"semantic_routes","type":"collection"}

View File

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"37af3c19f65c4d6e888df01f196338ac","collectionName":"subscription","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"d9b1309b67064da3a2a559e9e9a6b480","collectionName":"wrong_answer","type":"collection"}