morphik-core/dockerfile

34 lines
767 B
Plaintext
Raw Normal View History

2024-11-17 16:51:18 -05:00
# Use Python 3.12.5 as base image
FROM python:3.12.5-slim
# Set working directory
WORKDIR /app
2024-11-18 10:45:07 -05:00
# Unstructured.io dependencies
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 libmagic1 -y
RUN apt-get update && apt-get install -y \
tesseract-ocr \
&& rm -rf /var/lib/apt/lists/*
2024-11-17 16:51:18 -05:00
# Copy requirements and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Set environment variables
ENV PYTHONUNBUFFERED=1
2024-11-18 10:45:07 -05:00
# # Copy and load environment variables from .env file
# COPY .env .
# ENV $(cat .env | xargs)
2024-11-17 16:51:18 -05:00
# Expose port
2024-11-18 10:45:07 -05:00
EXPOSE 8000 443 80 20
2024-11-17 16:51:18 -05:00
# Run the server
2024-11-18 10:45:07 -05:00
# CMD ["python", "start_server.py"]
2024-12-03 21:46:25 -05:00
CMD ["uvicorn", "core.api:app", "--host", "127.0.0.1", "--port", "443"]