File size: 738 Bytes
ec674a5
adbf966
 
 
 
 
 
ec674a5
 
adbf966
ec674a5
adbf966
 
 
 
 
 
 
 
ec674a5
 
adbf966
ec674a5
 
 
 
 
adbf966
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
# Base image
FROM python:3.9-slim

# Create and switch to a non-root user
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"

# Set the working directory inside the container
WORKDIR /app

# Copy necessary files into the container with ownership set to the user
COPY --chown=user requirements.txt requirements.txt
COPY --chown=user app.py app.py
COPY --chown=user model model
COPY --chown=user Dataset Dataset
COPY --chown=user templates templates
COPY --chown=user static static
COPY --chown=user Utility Utility

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

# Expose the required port
EXPOSE 5000

# Set the default command to run the Flask app
CMD ["python", "app.py"]