Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +28 -18
Dockerfile
CHANGED
|
@@ -1,27 +1,37 @@
|
|
| 1 |
-
#
|
| 2 |
-
FROM python:3.
|
| 3 |
|
| 4 |
# Install system dependencies
|
| 5 |
-
RUN apt-get update &&
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
# Set
|
| 10 |
WORKDIR /app
|
| 11 |
|
| 12 |
-
#
|
| 13 |
-
COPY .
|
|
|
|
| 14 |
|
| 15 |
-
# Install
|
| 16 |
-
RUN
|
| 17 |
-
|
| 18 |
-
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
-
#
|
| 24 |
-
|
| 25 |
|
| 26 |
-
#
|
| 27 |
-
CMD ["
|
|
|
|
| 1 |
+
# Start from a base Python image
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
|
| 4 |
# Install system dependencies
|
| 5 |
+
RUN apt-get update && \
|
| 6 |
+
apt-get install -y --no-install-recommends \
|
| 7 |
+
build-essential curl wget postgresql postgresql-contrib nodejs npm supervisor && \
|
| 8 |
+
apt-get clean && \
|
| 9 |
+
rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
+
# Set up a working directory
|
| 12 |
WORKDIR /app
|
| 13 |
|
| 14 |
+
# Install Langfuse dependencies
|
| 15 |
+
COPY ./requirements.txt requirements.txt
|
| 16 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 17 |
|
| 18 |
+
# Install Node.js dependencies for Langfuse
|
| 19 |
+
RUN npm install -g npm@latest
|
| 20 |
+
COPY . .
|
| 21 |
+
RUN npm install
|
| 22 |
|
| 23 |
+
# Set up environment variables (for in-memory Postgres)
|
| 24 |
+
ENV POSTGRES_USER=pgstac \
|
| 25 |
+
POSTGRES_PASSWORD=pgstac \
|
| 26 |
+
POSTGRES_DB=postgis \
|
| 27 |
+
POSTGRES_HOST=127.0.0.1 \
|
| 28 |
+
POSTGRES_PORT=5432
|
| 29 |
+
|
| 30 |
+
# Set up a supervisor to run both Postgres and Langfuse
|
| 31 |
+
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
| 32 |
|
| 33 |
+
# Expose the default Langfuse port
|
| 34 |
+
EXPOSE 3000
|
| 35 |
|
| 36 |
+
# Start Supervisor
|
| 37 |
+
CMD ["/usr/bin/supervisord"]
|