Skip to content

Same agent Smaller bill. The tools and infrastructure to get more work from your AI. Fewer tokens. Less compute. Lower cost.

[Fix]: using DOCKER_PORT & PORT as the env variable, you can now bind the ports inside and outside docker container (#634)

Aman Agarwal3677abd9be3a
diff --git a/docker-compose.yml b/docker-compose.yml
index 9059bc64..05c4d477 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -23,8 +23,10 @@ services:
INIT_DB_USERNAME: ${OPENLIT_DB_USER:-default}
INIT_DB_PASSWORD: ${OPENLIT_DB_PASSWORD:-OPENLIT}
SQLITE_DATABASE_URL: file:/app/client/data/data.db
+ PORT: ${PORT:-3000}
+ DOCKER_PORT: ${PORT:-3000}
ports:
- - "3000:3000"
+ - "${PORT:-3000}:${DOCKER_PORT:-3000}"
depends_on:
- clickhouse
volumes:
diff --git a/src/client/Dockerfile b/src/client/Dockerfile
index 7b29ae3f..5578f72c 100644
--- a/src/client/Dockerfile
+++ b/src/client/Dockerfile
@@ -38,7 +38,7 @@ RUN apk --no-cache add bash openssl && \
npm install -g prisma
# Expose the port that Next.js will run on
-EXPOSE 3000
+EXPOSE ${DOCKER_PORT:-3000}
# Run Prisma migrations using npx
CMD ["/app/client/entrypoint.sh"]
diff --git a/src/client/logs/evaluation/auto.log b/src/client/logs/evaluation/auto.log
new file mode 100644
index 00000000..275765f1
--- /dev/null
+++ b/src/client/logs/evaluation/auto.log
@@ -0,0 +1,12 @@
+[2025-02-26T03:54:00.477Z] Starting auto evaluation
+[2025-02-26T03:54:01.768Z] Auto evaluation completed successfully
+[2025-02-26T03:55:01.018Z] Starting auto evaluation
+[2025-02-26T03:55:01.150Z] Auto evaluation completed successfully
+/bin/sh: node: command not found
+/bin/sh: node: command not found
+/bin/sh: node: command not found
+/bin/sh: /Users/amanagarwal/binaries/doku/src/client/scripts/evaluation/auto.js: Permission denied
+[2025-02-26T04:35:00.357Z] Starting auto evaluation
+[2025-02-26T04:35:01.528Z] Auto evaluation completed successfully
+[2025-02-26T04:36:00.783Z] Starting auto evaluation
+[2025-02-26T04:36:00.952Z] Auto evaluation completed successfully
diff --git a/src/client/package-lock.json b/src/client/package-lock.json
index 005604c9..aef9810c 100644
--- a/src/client/package-lock.json
+++ b/src/client/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "openlit",
- "version": "1.12.2",
+ "version": "1.12.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "openlit",
- "version": "1.12.2",
+ "version": "1.12.3",
"dependencies": {
"@anthropic-ai/sdk": "^0.21.1",
"@clickhouse/client": "^1.1.0",
diff --git a/src/client/package.json b/src/client/package.json
index 79f2341d..89c70de4 100644
--- a/src/client/package.json
+++ b/src/client/package.json
@@ -1,6 +1,6 @@
{
"name": "openlit",
- "version": "1.12.2",
+ "version": "1.12.3",
"private": true,
"scripts": {
"dev": "next dev",
diff --git a/src/client/scripts/entrypoint.sh b/src/client/scripts/entrypoint.sh
index 110104a7..3cf0dc0a 100755
--- a/src/client/scripts/entrypoint.sh
+++ b/src/client/scripts/entrypoint.sh
@@ -6,7 +6,7 @@ export NEXTAUTH_SECRET=$(openssl rand -base64 32)
# Set NextAuth.js environment variables
echo "NEXTAUTH_SECRET=$NEXTAUTH_SECRET" >> /etc/environment
-echo "NEXTAUTH_URL=http://localhost:3000" >> /etc/environment
+echo "NEXTAUTH_URL=http://localhost:${DOCKER_PORT:-3000}" >> /etc/environment
echo "SQLITE_DATABASE_URL=${SQLITE_DATABASE_URL:-file:../data/data.db}" >> /etc/environment
# Environment variables for DB config
@@ -26,5 +26,6 @@ prisma generate
# Run the seed
prisma db seed
+export PORT=${DOCKER_PORT:-3000}
# Start the Next.js application
exec node --max_old_space_size=512 $(which npm) start
diff --git a/src/dev-docker-compose.yml b/src/dev-docker-compose.yml
index 9974a979..3145a603 100644
--- a/src/dev-docker-compose.yml
+++ b/src/dev-docker-compose.yml
@@ -26,8 +26,10 @@ services:
INIT_DB_USERNAME: ${OPENLIT_DB_USER:-default}
INIT_DB_PASSWORD: ${OPENLIT_DB_PASSWORD:-OPENLIT}
SQLITE_DATABASE_URL: file:/app/client/data/data.db
+ PORT: ${PORT:-3000}
+ DOCKER_PORT: ${DOCKER_PORT:-3000}
ports:
- - "3000:3000"
+ - "${PORT:-3000}:${DOCKER_PORT:-3000}"
depends_on:
- clickhouse
volumes: