hellocomputer/Dockerfile

23 lines
696 B
Docker
Raw Normal View History

2024-05-25 22:13:21 +02:00
# Use an official Python runtime as a parent image
FROM python:3.12.2-slim
2024-05-25 22:13:21 +02:00
2024-05-25 22:40:59 +02:00
# Set up uv
ENV VIRTUAL_ENV=/usr/local
2024-05-25 22:13:21 +02:00
# Set the working directory in the container to /app
WORKDIR /app
# Add the current directory contents into the container at /app
ADD . /app
2024-05-25 22:48:15 +02:00
RUN pip install uv
2024-05-25 22:48:01 +02:00
RUN uv pip install --python /usr/local/bin/python3 --no-cache -r requirements.txt
RUN uv pip install --python /usr/local/bin/python3 -e .
2024-05-25 22:13:21 +02:00
2024-07-13 12:45:29 +02:00
# Install the httpfs extension for duckdb
RUN python3 -c "import duckdb; db = duckdb.connect(':memory:'); db.sql('install httpfs')"
2024-05-25 23:22:32 +02:00
EXPOSE 8080
2024-05-25 22:13:21 +02:00
# Run the command to start uvicorn
2024-06-11 22:32:49 +02:00
CMD ["uvicorn", "hellocomputer.main:app", "--host", "0.0.0.0", "--port", "8080", "--workers", "4"]