Change port connection in docker compose #2907
Unanswered
hungvipqt15
asked this question in
Support
Replies: 1 comment 6 replies
-
|
Hello @hungvipqt15! 👋 I'm here to help you with any bugs, questions, or contributions you have while you wait for a human maintainer. Let's tackle this together! To change the ports in your Docker Compose file, you need to update the port mappings for the version: "3.5"
services:
server:
build:
dockerfile: ./web/Dockerfile
context: .
args:
- NEXT_PUBLIC_LANGFUSE_CLOUD_REGION=${NEXT_PUBLIC_LANGFUSE_CLOUD_REGION}
depends_on:
- db
- redis
ports:
- "4000:3000" # Changed from 3000:3000 to 4000:3000
environment:
- DATABASE_URL=postgresql://postgres:postgres@db:5432/postgres
- NEXTAUTH_SECRET=mysecret
- SALT=mysalt
- ENCRYPTION_KEY=0000000000000000000000000000000000000000000000000000000000000000
- NEXTAUTH_URL=http://localhost:4000 # Changed from http://localhost:3000 to http://localhost:4000
- TELEMETRY_ENABLED=${TELEMETRY_ENABLED:-true}
- LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES=${LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES:-false}
- LANGFUSE_WORKER_HOST=${LANGFUSE_WORKER_HOST:-worker}
- LANGFUSE_WORKER_PASSWORD=${LANGFUSE_WORKER_PASSWORD:-mybasicauthsecret}
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4000/api/public/health"] # Changed from http://localhost:3000 to http://localhost:4000
interval: 30s
timeout: 10s
retries: 3
worker:
build:
dockerfile: ./worker/Dockerfile
context: .
args:
- NEXT_PUBLIC_LANGFUSE_CLOUD_REGION=${NEXT_PUBLIC_LANGFUSE_CLOUD_REGION}
depends_on:
- db
- redis
ports:
- "4040:3030" # Changed from 3030:3030 to 4040:3030
environment:
- DATABASE_URL=postgresql://postgres:postgres@db:5432/postgres
- NEXTAUTH_SECRET=mysecret
- TELEMETRY_ENABLED=${TELEMETRY_ENABLED:-true}
- LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES=${LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES:-false}
- PORT=${PORT:-3030}
- REDIS_HOST=${REDIS_HOST:-redis}
- REDIS_PORT=${REDIS_PORT:-6379}
- REDIS_AUTH=${REDIS_AUTH:-myredissecret}
- LANGFUSE_WORKER_PASSWORD=${LANGFUSE_WORKER_PASSWORD:-mybasicauthsecret}
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4040/api/health"] # Changed from http://localhost:3030 to http://localhost:4040
interval: 30s
timeout: 10s
retries: 3
redis:
image: redis:7.2.4
command: >
--requirepass ${REDIS_AUTH:-myredissecret}
restart: always
ports:
- 6379:6379
db:
image: postgres
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
ports:
- "5433:5432" # Changed from 5432:5432 to 5433:5432
volumes:
- database_data:/var/lib/postgresql/data
volumes:
database_data:
driver: localIn this updated file:
This should resolve the port conflicts on your company server. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am a newbie in using docker. Therefore I want to have some help from you. I built "docker compose up" normally in my local. But in company server, the port 3000 and 5432 of database portgres is busy. How can I change the file docker? Thank you.
Beta Was this translation helpful? Give feedback.
All reactions