Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 46 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
---
version: '3.4'

volumes:
weaviate_data: {}

services:
weaviate:
command:
Expand All @@ -13,6 +17,8 @@ services:
ports:
- 8080:8080
restart: on-failure:0
volumes:
- weaviate_data:/var/lib/weaviate
environment:
QUERY_DEFAULTS_LIMIT: 25
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
Expand All @@ -21,8 +27,47 @@ services:
ENABLE_MODULES: 'multi2vec-bind'
BIND_INFERENCE_API: 'http://multi2vec-bind:8080'
CLUSTER_HOSTNAME: 'node1'
BACKUP_FILESYSTEM_PATH: '/mnt/blockstorage'
depends_on:
multi2vec-bind:
condition: service_healthy
healthcheck:
test: wget --no-verbose --tries=3 --spider http://localhost:8080/v1/.well-known/ready || exit 1
interval: 5s
timeout: 30s
retries: 5
start_period: 10s
multi2vec-bind:
image: semitechnologies/multi2vec-bind:imagebind
#image: multi2vec-bind:imagebind
environment:
ENABLE_CUDA: '0'
...
healthcheck:
test: wget --no-verbose --tries=3 --spider http://localhost:8080/.well-known/ready || exit 1
interval: 10s
retries: 5
start_period: 15s
timeout: 30s
ports:
- 8081:8080
web-app:
build:
context: ./web-app
ports:
- 4200:80
- 80:80
environment:
- WEAVIATE_HOST="weaviate:8080"
healthcheck:
test: curl --fail http://localhost:80 || exit 1
interval: 20s
retries: 5
start_period: 10s
timeout: 10s
node-app:
build:
context: ./node-app
depends_on:
weaviate:
condition: service_healthy
...
6 changes: 6 additions & 0 deletions node-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM node
WORKDIR /app
COPY . .
RUN npm install
RUN npm run compile-ts
CMD node build/index.js && exit 1
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion node-app/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import weaviate, { WeaviateClient } from 'weaviate-ts-client';
let client: WeaviateClient;

export const getWeaviateClient = () => {

if (!client) {
client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
host: process.env.WEAVIATE_HOST || 'localhost:8080',
});
};

Expand Down
2 changes: 1 addition & 1 deletion node-app/src/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { FileInfo, getBase64, listFiles } from './util';
// const sourceImages = 'source/input_images/';
// const sourceAudio = 'source/audio/';
// const sourceVideo = 'source/video/';
const sourceBase = '../web-app/src/assets';
const sourceBase = '/app/source';
const sourceImages = sourceBase + '/image/'
const sourceAudio = sourceBase + '/audio/';
const sourceVideo = sourceBase + '/video/';
Expand Down
6 changes: 6 additions & 0 deletions node-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ const run = async () => {
// await deleteCollection(collectionName);
await createBindCollection(collectionName);
await importMediaFiles(collectionName);
console.log("######################")
console.log("######################")
console.log("All set! You can now browse to http://localhost:4200")
console.log("######################")
console.log("######################")

}

run();
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ In this step, we will run an Angular app, which allows us to search through our
1. Go to the web project

```
cd wep-app
cd web-app
```

2. Install packages
Expand All @@ -75,4 +75,4 @@ Run the app with the Angular CLI, which will automatically open the app in your

```
ng serve -o
```
```
9 changes: 9 additions & 0 deletions web-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node as build
WORKDIR /app
COPY . .
RUN npm install
RUN npm install -g @angular/cli
RUN ng build --output-path=/tmp/app
# BASE IMAGE
FROM nginx as runtime
COPY --from=build /tmp/app /usr/share/nginx/html