jpwahle commited on
Commit
5142c8f
1 Parent(s): 5b62edd

Add Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -0
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Starting from the Grobid image
2
+ FROM lfoppiano/grobid:0.7.3
3
+
4
+ # Setting the user to root for installation purposes
5
+ USER root
6
+
7
+ # Create necessary directories for Grobid
8
+ RUN mkdir -m 777 -p /opt/grobid/grobid-home/tmp
9
+
10
+ # Install supervisord and python (for gradio)
11
+ RUN apt-get update && apt-get install -y supervisor python3 python3-pip && rm -rf /var/lib/apt/lists/*
12
+
13
+ # Copy your gradio app to the image
14
+ COPY . /app/
15
+ COPY ./data /app/data
16
+
17
+ # Install gradio
18
+ RUN pip3 install gradio
19
+ RUN pip3 install -r /app/requirements.txt
20
+
21
+ # Supervisord configuration
22
+ RUN echo "[supervisord]" > /etc/supervisor/conf.d/supervisord.conf && \
23
+ echo "nodaemon=true" >> /etc/supervisor/conf.d/supervisord.conf && \
24
+ echo "" >> /etc/supervisor/conf.d/supervisord.conf && \
25
+ echo "[program:grobid]" >> /etc/supervisor/conf.d/supervisord.conf && \
26
+ echo "command=/opt/grobid/grobid-service/bin/grobid-service" >> /etc/supervisor/conf.d/supervisord.conf && \
27
+ echo "" >> /etc/supervisor/conf.d/supervisord.conf && \
28
+ echo "[program:gradio]" >> /etc/supervisor/conf.d/supervisord.conf && \
29
+ echo "command=python3 /app/main.py" >> /etc/supervisor/conf.d/supervisord.conf
30
+
31
+ # Start processes with supervisord
32
+ CMD ["/usr/bin/supervisord"]