-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.app
29 lines (23 loc) · 861 Bytes
/
Dockerfile.app
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
# Dockerfile for the app container
# Use an official Python runtime as a parent image
FROM python:3.12-slim
# set the working directory in the container
WORKDIR /app
# copy the dependencies file to the working directory
COPY requirements.txt .
COPY app.py .
COPY utils/ ./utils/
# update, upgrade and install required packages
RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \
build-essential \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* \
&& python3 -m venv .venv \
&& . .venv/bin/activate \
&& pip --no-cache-dir install --upgrade pip \
&& pip --no-cache-dir install -r requirements.txt
# Set the environment variables
ENV OLLAMA_HOST=http://ollama:11434
# Export the port
EXPOSE 7860
# command to run on container start
CMD [".venv/bin/python", "app.py"]