-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.unified
40 lines (28 loc) · 993 Bytes
/
Dockerfile.unified
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Use an official Python runtime as a parent image
FROM python:3.10-slim
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV BENTOML_HOME=/bentoml
# Install Python and other dependencies
RUN apt-get update && apt-get install -y python3 python3-pip python3-venv curl && apt-get clean
# Set the working directory in the container
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Create and activate a virtual environment
RUN python3 -m venv /venv
ENV PATH="/venv/bin:$PATH"
# Upgrade pip
RUN /venv/bin/pip install --upgrade pip
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Install gRPC tools
RUN pip install grpcio grpcio-tools
# Expose the port the app runs on
EXPOSE 50051
# Copy the entrypoint script
COPY entrypoint.sh /app/entrypoint.sh
# Make the entrypoint script executable
RUN chmod +x /app/entrypoint.sh
# Run the entrypoint script
CMD ["/app/entrypoint.sh"]