11# Use an official Python runtime as a parent image
2- FROM python:3.5
2+ FROM python:3.8
33
4- # Set the working directory to /app
5- WORKDIR /data
4+ # Set the working directory to /app for installing rdfizer
5+ WORKDIR /app
66
7- # Copy the current directory contents into the container at /app
8- ADD . /app
7+ # Copy the requirements.txt alone to re-install packages only if it has changed
8+ ADD requirements.txt /app
99
1010# Install any needed packages specified in requirements.txt
11- RUN cd /app && pip3 install --trusted-host pypi.python.org -r requirements.txt && cd /data
11+ RUN pip3 install --trusted-host pypi.python.org -r requirements.txt
12+
13+ # Add all the source code
14+ ADD . /app
15+
16+ # Fix issue with symlinks not being copied in the docker image:
17+ ADD README.md VERSION requirements.txt /app/rdfizer/
18+
19+ # Install the rdfizer package
20+ RUN pip install ./rdfizer
21+
22+ # Set the working directory to /data
23+ WORKDIR /data
1224
13- # Make port 80 available to the world outside this container
14- EXPOSE 4000
25+ # Use the rdfizer package as entrypoint
26+ ENTRYPOINT [ "rdfizer" ]
1527
16- # Define environment variable
17- ENV NAME RDFizer
28+ # Default args passed to the entrypoint
29+ # Run config.ini in workdir /data by default
30+ CMD ["-c" , "config.ini" ]
1831
19- # Run app.py when the container launches
20- CMD ["python3" , "/app/app.py" ]
32+ # # Usage:
33+ # docker build -t rdfizer:latest -f Dockerfile.cli .
34+ # docker run -it --rm -v $(pwd)/example:/data rdfizer:latest -c config.ini
0 commit comments