diff --git a/app.dockerfile b/app.dockerfile index ab8bfaa..105cf86 100644 --- a/app.dockerfile +++ b/app.dockerfile @@ -2,11 +2,8 @@ FROM node:alpine ARG NEXT_PUBLIC_WS_URL ARG NEXT_PUBLIC_API_URL -ARG PORT - ENV NEXT_PUBLIC_WS_URL=${NEXT_PUBLIC_WS_URL} ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL} -ENV PORT=${PORT} WORKDIR /home/perplexica diff --git a/docker-compose.yaml b/docker-compose.yaml index dc55c29..ac83575 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -4,7 +4,7 @@ services: volumes: - ./searxng:/etc/searxng:rw ports: - - 31336:8080 + - 4000:8080 networks: - perplexica-network @@ -17,7 +17,7 @@ services: depends_on: - searxng ports: - - 31338:31338 + - 3001:3001 networks: - perplexica-network @@ -26,15 +26,14 @@ services: context: . dockerfile: app.dockerfile args: - - NEXT_PUBLIC_API_URL=http://127.0.0.1:31338/api - - NEXT_PUBLIC_WS_URL=ws://127.0.0.1:31338 - - PORT=31337 + - NEXT_PUBLIC_API_URL=http://127.0.0.1:3001/api + - NEXT_PUBLIC_WS_URL=ws://127.0.0.1:3001 depends_on: - perplexica-backend ports: - - 31337:31337 + - 3000:3000 networks: - perplexica-network networks: - perplexica-network: \ No newline at end of file + perplexica-network: diff --git a/sample.config.toml b/sample.config.toml index 3c7f31b..8d35666 100644 --- a/sample.config.toml +++ b/sample.config.toml @@ -1,6 +1,5 @@ [GENERAL] -PORT = 31338 # Port to run the server on -BIND_ADDRESS = "0.0.0.0" +PORT = 3001 # Port to run the server on SIMILARITY_MEASURE = "cosine" # "cosine" or "dot" [API_KEYS] @@ -9,4 +8,4 @@ GROQ = "" # Groq API key - gsk_1234567890abcdef1234567890abcdef [API_ENDPOINTS] SEARXNG = "http://localhost:32768" # SearxNG API URL -OLLAMA = "" # Ollama API URL - http://host.docker.internal:11434 +OLLAMA = "" # Ollama API URL - http://host.docker.internal:11434 \ No newline at end of file diff --git a/src/app.ts b/src/app.ts index 33184bf..b8c2371 100644 --- a/src/app.ts +++ b/src/app.ts @@ -3,11 +3,10 @@ import express from 'express'; import cors from 'cors'; import http from 'http'; import routes from './routes'; -import { getBindAddress, getPort } from './config'; +import { getPort } from './config'; import logger from './utils/logger'; const port = getPort(); -const bindAddress = getBindAddress(); const app = express(); const server = http.createServer(app); @@ -24,7 +23,7 @@ app.get('/api', (_, res) => { res.status(200).json({ status: 'ok' }); }); -server.listen(port, bindAddress, () => { +server.listen(port, () => { logger.info(`Server is running on port ${port}`); }); diff --git a/src/config.ts b/src/config.ts index f600f58..7c0c7f1 100644 --- a/src/config.ts +++ b/src/config.ts @@ -7,7 +7,6 @@ const configFileName = 'config.toml'; interface Config { GENERAL: { PORT: number; - BIND_ADDRESS: string; SIMILARITY_MEASURE: string; }; API_KEYS: { @@ -31,8 +30,6 @@ const loadConfig = () => export const getPort = () => loadConfig().GENERAL.PORT; -export const getBindAddress = () => loadConfig().GENERAL.BIND_ADDRESS; - export const getSimilarityMeasure = () => loadConfig().GENERAL.SIMILARITY_MEASURE; diff --git a/ui/.env.example b/ui/.env.example index 9869283..57a3ed9 100644 --- a/ui/.env.example +++ b/ui/.env.example @@ -1,2 +1,2 @@ -NEXT_PUBLIC_WS_URL=ws://localhost:31338 -NEXT_PUBLIC_API_URL=http://localhost:31338/api \ No newline at end of file +NEXT_PUBLIC_WS_URL=ws://localhost:3001 +NEXT_PUBLIC_API_URL=http://localhost:3001/api \ No newline at end of file