2023-07-07 07:38:51 +00:00
|
|
|
# Define the image argument and provide a default value
|
|
|
|
ARG IMAGE=python:3-slim-bullseye
|
|
|
|
|
|
|
|
# Use the image as specified
|
|
|
|
FROM ${IMAGE}
|
|
|
|
|
|
|
|
# Re-declare the ARG after FROM
|
|
|
|
ARG IMAGE
|
|
|
|
|
|
|
|
# Update and upgrade the existing packages
|
|
|
|
RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \
|
|
|
|
python3 \
|
|
|
|
python3-pip \
|
|
|
|
ninja-build \
|
2023-07-09 05:36:39 +00:00
|
|
|
libopenblas-dev \
|
2023-07-07 07:38:51 +00:00
|
|
|
build-essential
|
|
|
|
|
|
|
|
RUN mkdir /app
|
|
|
|
WORKDIR /app
|
|
|
|
COPY . /app
|
|
|
|
|
2023-07-08 01:38:46 +00:00
|
|
|
RUN python3 -m pip install --upgrade pip pytest cmake scikit-build setuptools fastapi uvicorn sse-starlette pydantic-settings
|
2023-07-07 07:38:51 +00:00
|
|
|
|
|
|
|
RUN make build && make clean
|
|
|
|
|
|
|
|
# Set environment variable for the host
|
|
|
|
ENV HOST=0.0.0.0
|
|
|
|
ENV PORT=8000
|
|
|
|
|
|
|
|
# Expose a port for the server
|
|
|
|
EXPOSE 8000
|
|
|
|
|
|
|
|
# Run the server start script
|
|
|
|
CMD ["/bin/sh", "/app/docker/simple/run.sh"]
|