legend1234 commited on
Commit
50ee429
·
1 Parent(s): f51532a

Fix permission issue

Browse files
Files changed (3) hide show
  1. Dockerfile +6 -1
  2. docker-compose.yml +4 -0
  3. gunicorn_config.py +2 -2
Dockerfile CHANGED
@@ -17,7 +17,12 @@ COPY . .
17
  # Create necessary directories with proper permissions
18
  RUN mkdir -p uploads md_files && \
19
  chmod 777 uploads && \
20
- chmod 755 md_files
 
 
 
 
 
21
 
22
  # Default command
23
  CMD ["gunicorn", "--config", "gunicorn_config.py", "app:app"]
 
17
  # Create necessary directories with proper permissions
18
  RUN mkdir -p uploads md_files && \
19
  chmod 777 uploads && \
20
+ chmod 755 md_files && \
21
+ mkdir -p /tmp/matplotlib && \
22
+ chmod 777 /tmp/matplotlib
23
+
24
+ # Set matplotlib config directory
25
+ ENV MPLCONFIGDIR=/tmp/matplotlib
26
 
27
  # Default command
28
  CMD ["gunicorn", "--config", "gunicorn_config.py", "app:app"]
docker-compose.yml CHANGED
@@ -9,8 +9,11 @@ services:
9
  volumes:
10
  - .:/app
11
  - upload_data:/app/uploads
 
 
12
  environment:
13
  - FLASK_ENV=production
 
14
  deploy:
15
  resources:
16
  limits:
@@ -20,3 +23,4 @@ services:
20
 
21
  volumes:
22
  upload_data:
 
 
9
  volumes:
10
  - .:/app
11
  - upload_data:/app/uploads
12
+ - ./md_files:/app/md_files
13
+ - matplotlib_cache:/tmp/matplotlib
14
  environment:
15
  - FLASK_ENV=production
16
+ - MPLCONFIGDIR=/tmp/matplotlib
17
  deploy:
18
  resources:
19
  limits:
 
23
 
24
  volumes:
25
  upload_data:
26
+ matplotlib_cache:
gunicorn_config.py CHANGED
@@ -27,10 +27,10 @@ errorlog = "-"
27
  access_log_format = '%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"'
28
 
29
  # Bind address - use HF_PORT for Hugging Face deployment
30
- bind = "0.0.0.0:8009"
31
 
32
  # Worker class
33
- worker_class = "sync"
34
 
35
  # Process name
36
  proc_name = "selector_server"
 
27
  access_log_format = '%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"'
28
 
29
  # Bind address - use HF_PORT for Hugging Face deployment
30
+ bind = "0.0.0.0:8009" # Match HF port
31
 
32
  # Worker class
33
+ worker_class = "gthread" # Use gthread instead of sync
34
 
35
  # Process name
36
  proc_name = "selector_server"