upload
Browse files- Dockerfile +4 -0
- serve_grobid.sh +14 -0
Dockerfile
CHANGED
|
@@ -6,6 +6,7 @@ WORKDIR /app
|
|
| 6 |
|
| 7 |
# Copy the requirements file into the container
|
| 8 |
COPY requirements.txt .
|
|
|
|
| 9 |
|
| 10 |
# Install any needed packages specified in requirements.txt
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
@@ -16,5 +17,8 @@ COPY . /app
|
|
| 16 |
# Expose port 7860 for the Flask app to listen on
|
| 17 |
EXPOSE 7860
|
| 18 |
|
|
|
|
|
|
|
|
|
|
| 19 |
# Run the command to start the Flask app
|
| 20 |
CMD ["python", "app.py"]
|
|
|
|
| 6 |
|
| 7 |
# Copy the requirements file into the container
|
| 8 |
COPY requirements.txt .
|
| 9 |
+
COPY serve_grobid.sh .
|
| 10 |
|
| 11 |
# Install any needed packages specified in requirements.txt
|
| 12 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
| 17 |
# Expose port 7860 for the Flask app to listen on
|
| 18 |
EXPOSE 7860
|
| 19 |
|
| 20 |
+
RUN chmod +x serve_grobid.sh
|
| 21 |
+
RUN ./serve_grobid.sh
|
| 22 |
+
|
| 23 |
# Run the command to start the Flask app
|
| 24 |
CMD ["python", "app.py"]
|
serve_grobid.sh
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
# download GROBID if directory does not exist
|
| 4 |
+
declare -r GROBID_VERSION="0.6.2" # or change to current stable version
|
| 5 |
+
|
| 6 |
+
if [ ! -d grobid-${GROBID_VERSION} ]; then
|
| 7 |
+
wget https://github.com/kermitt2/grobid/archive/${GROBID_VERSION}.zip
|
| 8 |
+
unzip "${GROBID_VERSION}.zip"
|
| 9 |
+
rm "${GROBID_VERSION}.zip"
|
| 10 |
+
fi
|
| 11 |
+
|
| 12 |
+
# run GROBID
|
| 13 |
+
cd grobid-${GROBID_VERSION} || exit
|
| 14 |
+
./gradlew run &
|