shrijayan commited on
Commit
c4c35c0
·
verified ·
1 Parent(s): 7ea2858

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -2
Dockerfile CHANGED
@@ -2,13 +2,23 @@ FROM python:3.9-slim
2
 
3
  WORKDIR /app
4
 
5
- RUN apt-get update && apt-get install -y curl
 
 
 
 
 
 
 
 
 
6
 
7
  COPY requirements.txt .
8
  RUN pip install --no-cache-dir -r requirements.txt
9
 
10
  COPY app.py config.yaml ./
11
 
12
- VOLUME /data
 
13
 
14
  CMD ["python", "app.py"]
 
2
 
3
  WORKDIR /app
4
 
5
+ # Set up proper permissions and dependencies
6
+ RUN apt-get update && \
7
+ apt-get install -y --no-install-recommends curl && \
8
+ rm -rf /var/lib/apt/lists/* && \
9
+ mkdir -p /data && \
10
+ chmod 777 /data && \
11
+ useradd -m appuser && \
12
+ chown appuser:appuser /data
13
+
14
+ USER appuser
15
 
16
  COPY requirements.txt .
17
  RUN pip install --no-cache-dir -r requirements.txt
18
 
19
  COPY app.py config.yaml ./
20
 
21
+ # Set matplotlib config directory
22
+ ENV MPLCONFIGDIR=/tmp/matplotlib
23
 
24
  CMD ["python", "app.py"]