Chris4K commited on
Commit
55da58c
·
verified ·
1 Parent(s): 9c4d77b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -13
Dockerfile CHANGED
@@ -1,22 +1,35 @@
1
- # Use the official Langfuse image
2
  FROM langfuse/langfuse:2
3
 
4
- # Set environment variables for a minimal, ephemeral setup
5
- ENV DATABASE_URL=postgresql://postgres:postgres@localhost:5432/langfuse
6
- ENV NEXTAUTH_SECRET=your_random_secret_here
7
- ENV SALT=your_random_salt_here
8
- ENV NEXTAUTH_URL=https://chris4k-langfuse.hf.space
9
- ENV HOSTNAME=0.0.0.0
 
10
  ENV PORT=7860
 
 
11
 
12
- # Use an in-memory SQLite database for HF Spaces
13
- # Note: This is not recommended for production, only for demonstration
14
- ENV DATABASE_TYPE=sqlite
 
 
 
 
15
 
16
- # Disable signup if needed
 
17
  ENV AUTH_DISABLE_SIGNUP=true
18
 
19
- # Expose the default Hugging Face Spaces port
 
 
 
 
20
  EXPOSE 7860
21
 
22
- # The default CMD from the Langfuse image should work
 
 
1
+ # Use specific version 2 tag
2
  FROM langfuse/langfuse:2
3
 
4
+ # Install debugging tools
5
+ RUN apt-get update && apt-get install -y \
6
+ curl \
7
+ postgresql-client \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ # Set critical environment variables
11
  ENV PORT=7860
12
+ ENV HOSTNAME=0.0.0.0
13
+ ENV NODE_ENV=production
14
 
15
+ # Generate a secret if not provided
16
+ ENV NEXTAUTH_SECRET=randomsecretkey123
17
+ ENV NEXTAUTH_URL=https://chris4k-langfuse.hf.space
18
+ ENV SALT=randomsalt123
19
+
20
+ # Use SQLite as a fallback database
21
+ ENV DATABASE_URL=sqlite:///tmp/langfuse.db
22
 
23
+ # Disable certain features that might cause loops
24
+ ENV LANGFUSE_AUTO_POSTGRES_MIGRATION_DISABLED=true
25
  ENV AUTH_DISABLE_SIGNUP=true
26
 
27
+ # Create a debug startup script
28
+ COPY start.sh /start.sh
29
+ RUN chmod +x /start.sh
30
+
31
+ # Expose port
32
  EXPOSE 7860
33
 
34
+ # Use the custom start script
35
+ CMD ["/start.sh"]