File size: 1,798 Bytes
42ef6c5
d64a8e1
42ef6c5
d64a8e1
42ef6c5
d64a8e1
42ef6c5
 
d64a8e1
42ef6c5
 
d64a8e1
113ec44
42ef6c5
 
 
 
 
 
 
 
 
 
1733dde
42ef6c5
 
 
a0680e8
113ec44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
836bdb6
 
be91756
 
 
 
 
 
 
8d28c75
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# FROM python:3.10

# WORKDIR /code

# COPY ./requirements.txt /code/requirements.txt

# RUN apt-get update && xargs -r -a /packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
# RUN pip3 install --no-cache-dir --upgrade -r /code/requirements.txt

# # we are using open AI here. no need to download model
# # RUN python3 -c 'from transformers import pipeline, AutoTokenizer, AutoModelForSeq2SeqLM;model=AutoModelForSeq2SeqLM.from_pretrained("facebook/bart-large-cnn");model.save_pretrained("models");tokenizer=AutoTokenizer.from_pretrained("facebook/bart-large-cnn");tokenizer.save_pretrained("models")'



# # COPY ./app /code/app

# EXPOSE 8501
# CMD streamlit run app.py \
#     --server.headless true \
#     --server.enableCORS false \
#     --server.enableXsrfProtection false \
#     --server.fileWatcherType none

FROM python:3.9
WORKDIR /app
COPY requirements.txt ./requirements.txt
RUN pip install -r requirements.txt
EXPOSE 8501
# Set up a new user named "user" with user ID 1000
RUN useradd -m -u 1000 user
# Switch to the "user" user
USER user
# Set home to the user's home directory
ENV HOME=/home/user
ENV PATH=/home/user/.local/bin:$PATH

# Set the working directory to the user's home directory
WORKDIR $HOME
RUN mkdir app
WORKDIR $HOME/app
COPY . $HOME/app
 
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
COPY --chown=user . $HOME/app
# ENTRYPOINT ["streamlit", "run"]
# CMD ["app.py", "--server.port", "7860", "--server.enableCORS, false", "--server.enableXsrfProtection, false", "--server.fileWatcherType, none"]

 CMD streamlit run app.py \
     --server.port 7860 \
     --server.headless true \
     --server.enableCORS false \
     --server.enableXsrfProtection false \
     --server.fileWatcherType none