Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

Docker: signal forwarding, migrations in entrypoint, build args (SALT), readme (#427)

Marc Klingen51074a1f033a
diff --git a/Dockerfile b/Dockerfile
index bdd7443fbc..66ee40fa72 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -58,6 +58,8 @@ ARG NEXTAUTH_SECRET
ARG NEXTAUTH_URL
ARG SALT
+RUN apk add --no-cache dumb-init
+
WORKDIR /app
ENV NODE_ENV production
@@ -68,6 +70,7 @@ RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
RUN npm install --no-package-lock --no-save cron
+RUN npm install -g --no-package-lock --no-save prisma
COPY --from=builder /app/public ./public
@@ -79,6 +82,7 @@ COPY --from=builder --chown=nextjs:nodejs /app/prisma ./prisma
COPY --chown=nextjs:nodejs cron.js ./cron.js
COPY --chown=nextjs:nodejs entrypoint.sh ./entrypoint.sh
+RUN chmod +x ./entrypoint.sh
USER nextjs
@@ -86,4 +90,4 @@ USER nextjs
ENV PORT 3000
# CMD ["node", "server.js"]
-CMD ["/bin/sh", "entrypoint.sh"]
+CMD ["dumb-init", "--", "./entrypoint.sh"]
diff --git a/README.md b/README.md
index 0c95c1d35d..7ec1a17ee4 100644
--- a/README.md
+++ b/README.md
@@ -107,9 +107,6 @@ cd langfuse
# Run server and database
docker compose up -d
-
-# Apply db migrations
-DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres DIRECT_URL=postgresql://postgres:postgres@localhost:5432/postgres npx prisma migrate deploy
```
#### Self-host (Docker)
@@ -265,9 +262,6 @@ docker-compose pull
# Run server and db
docker compose up -d
-
-# Apply db migrations
-DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres DIRECT_URL=postgresql://postgres:postgres@localhost:5432/postgres npx prisma migrate deploy
```
### Run Langfuse in CI for integration tests
diff --git a/docker-compose.build.yml b/docker-compose.build.yml
index aa93bd5510..0b4006b378 100644
--- a/docker-compose.build.yml
+++ b/docker-compose.build.yml
@@ -7,6 +7,7 @@ services:
args:
- DATABASE_URL=postgresql://postgres:postgres@db:5432/postgres
- NEXTAUTH_SECRET=mysecret
+ - SALT=mysalt
- NEXTAUTH_URL=http:localhost:3000
depends_on:
- db
@@ -17,11 +18,11 @@ services:
- DATABASE_URL=postgresql://postgres:postgres@db:5432/postgres
- DIRECT_URL=postgresql://postgres:postgres@db:5432/postgres
- NEXTAUTH_SECRET=mysecret
+ - SALT=mysalt
- NEXTAUTH_URL=http:localhost:3000
- TELEMETRY_ENABLED=${TELEMETRY_ENABLED:-true}
- NEXT_PUBLIC_SIGN_UP_DISABLED=${NEXT_PUBLIC_SIGN_UP_DISABLED:-false}
- LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES=${LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES:-false}
- - SALT=${SALT:-"salt"}
db:
image: postgres
diff --git a/docker-compose.yml b/docker-compose.yml
index 74aa584aff..acdb205a61 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -12,11 +12,11 @@ services:
- DATABASE_URL=postgresql://postgres:postgres@db:5432/postgres
- DIRECT_URL=postgresql://postgres:postgres@db:5432/postgres
- NEXTAUTH_SECRET=mysecret
+ - SALT=mysalt
- NEXTAUTH_URL=http:localhost:3000
- TELEMETRY_ENABLED=${TELEMETRY_ENABLED:-true}
- NEXT_PUBLIC_SIGN_UP_DISABLED=${NEXT_PUBLIC_SIGN_UP_DISABLED:-false}
- LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES=${LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES:-false}
- - SALT=${SALT:-"salt"}
db:
image: postgres
diff --git a/entrypoint.sh b/entrypoint.sh
index b79464abdd..afb8cb0625 100644
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -1,2 +1,5 @@
+#!/bin/sh
+
+prisma migrate deploy
node cron.js &
node server.js