File size: 784 Bytes
ec14c0e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Use a Python base image
FROM python:3.9

RUN useradd -m -u 1000 user

USER user

ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH

WORKDIR $HOME/app

# Copy the required files to the working directory
COPY app.py .
COPY ./templates/index.html /code/templates/index.html
COPY ./static/styles.css /code/static/styles.css 
COPY ./static/scripts.js /code/static/scripts.js
COPY ./requirements.txt /code/requirements.txt

# Install the required packages
RUN pip install --no-cache-dir -r /code/requirements.txt

# Get secret SECRET_EXAMPLE and clone it as repo at buildtime
RUN --mount=type=secret,id=GEMINI_API_KEY,mode=0444,required=true

COPY --chown=user . $HOME/app

# Expose the port that the Flask app will run on
EXPOSE 7860

# Start the Flask app
CMD ["python", "app.py"]