Langfuse-demo / Dockerfile
InnoLink's picture
Update Dockerfile
3e6b8fc verified
raw
history blame
1.49 kB
#FROM langfuse/langfuse:2
#USER root
### Install PostgreSQL and necessary dependencies
#RUN apk update && apk add --no-cache \
# postgresql \
# postgresql-contrib \
# net-tools \
# iproute2 \
# sed
### Copy and set up the wrapper script
#COPY docker-entrypoint-wrapper.sh /docker-entrypoint-wrapper.sh
#RUN chmod +x /docker-entrypoint-wrapper.sh
#EXPOSE 3000
#ENTRYPOINT ["dumb-init", "--", "/docker-entrypoint-wrapper.sh"]
#========================
### added from article "create your first docker"
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
# you will also find guides on how best to write your Dockerfile
FROM python:3.11-slim
# alpine as a slim python-os option(grok recommended)
#FROM python:3.11-alpine
# The two following lines are requirements for the Dev Mode to be functional
# Learn more about the Dev Mode at https://huggingface.co/dev-mode-explorers
RUN useradd -m -u 1000 user
WORKDIR /app
COPY --chown=user ./requirements.txt requirements.txt
#RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Install uv for faster dependency resolution, then install packages system-wide
RUN pip install --upgrade pip && \
pip install --no-cache-dir uv && \
uv pip install --system --no-cache-dir -r requirements.txt
COPY --chown=user . /app
USER user
# Set home to the user's home directory
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]