Skip to content

Commit

Permalink
fix docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
Administrator committed Jul 17, 2024
1 parent be8f9a4 commit 091fb15
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ services:
command: /bin/bash -c "Xvfb :99 -screen 0 1280x1024x24 & poetry run python -m lens_gpt_backend.main"
environment:
- DISPLAY=:99
- OPENAI_API_KEY=${OPENAI_API_KEY}
restart: always

frontend:
Expand All @@ -19,7 +20,8 @@ services:
ports:
- 3001:3000
environment:
- NEXT_PUBLIC_API_URL=http://lens-api:5000
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-http://localhost:3002}

restart: always
depends_on:
- lens-api
6 changes: 5 additions & 1 deletion frontend/components/image-classification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
ClassificationCardSecondHandOffers,
} from './image-classification-product-cards';
import ImageDropzone from './image-dropzone';
import Config from "@/lib/config";

export default function ImageClassification() {
const [showClassifyCard, setShowClassifyCard] = useState(false);
Expand All @@ -39,7 +40,10 @@ export default function ImageClassification() {
const formData = new FormData();
formData.append('file', image);

fetch('http://localhost:3002/classify', {
// cut of tailing / of url
const apiUrl = Config.apiUrl.replace(/\/$/, '');

fetch(apiUrl + '/classify', {
method: 'POST',
body: formData,
})
Expand Down

0 comments on commit 091fb15

Please sign in to comment.