File size: 662 Bytes
a842ea6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Use the official Python 3.10.9 image
FROM python:3.11.5

# Copy the current directory contents into the container at .
COPY . .

# Set the working directory to /
WORKDIR /

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

# Install GPG
RUN apt-get update && apt-get install -y gnupg

# Decrypt the sensitive file
RUN --mount=type=secret,id=DECRYPT_KEY,mode=0444,required=true \
    gpg --batch --yes --passphrase $(cat /run/secrets/DECRYPT_KEY) --decrypt searcher.py.gpg > searcher.py

# Start the FastAPI app on port 7860, the default port expected by Spaces
CMD ["uvicorn", "router:app", "--host", "0.0.0.0", "--port", "7860"]