File size: 990 Bytes
b8f4ebc
6aa0bc7
b8f4ebc
4387bcb
 
 
cfed1a5
 
 
 
 
b8f4ebc
 
 
 
cfed1a5
b8f4ebc
7257ab4
5e2f5b2
7257ab4
b8f4ebc
 
 
 
 
 
 
cfed1a5
b8f4ebc
6aa0bc7
 
 
 
 
 
 
 
 
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
# Use an official Python runtime as a parent image
FROM python:3.9-slim AS base

RUN apt-get update && \
    apt-get install -y git

RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH

# Set environment variables
ENV PYTHONUNBUFFERED=1

# Set the working directory in the container
WORKDIR $HOME/app

# There was a problem with the permission of the HuggingFace's cache directory, so we changed the path to another that should be writeable.
ENV HF_HOME=$HOME/app/.cache

# Copy the requirements file into the container
COPY requirements.txt .

# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Copy the application code into the container
COPY --chown=user . .

# Stage: Execute a test for the text search engine.
FROM base AS debug

CMD ["python", "-m", "pdb", "text_search_engine.py"]

# Stage: Execute the Streamlit application.
FROM base AS run

CMD ["streamlit", "run", "streamlit_app.py", "--server.port", "7860"]