-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
52 lines (41 loc) · 1.08 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Dockerfile for HDT Tools with API support
# Use an official Ubuntu as a base image
FROM ubuntu:20.04
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
# Install dependencies
RUN apt-get update && apt-get install -y \
autoconf \
libtool \
zlib1g \
zlib1g-dev \
pkg-config \
libserd-0-0 \
libserd-dev \
git \
build-essential \
wget \
python3 \
python3-pip && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /usr/src
# Clone the HDT repository
RUN git clone https://github.com/rdfhdt/hdt-cpp.git && \
cd hdt-cpp && \
./autogen.sh && \
./configure && \
make -j$(nproc) && \
make install
# Add HDT tools to the PATH
ENV PATH="/usr/src/hdt-cpp/libhdt/tools:$PATH"
# Install FastAPI and Uvicorn
RUN pip3 install fastapi uvicorn
# Copy API source code
COPY ./api /usr/src/api
# Set the working directory to the API folder
WORKDIR /usr/src/api
# Expose the API port
EXPOSE 8000
# Default command to run the API
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]