-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-API
More file actions
43 lines (31 loc) · 1.52 KB
/
Dockerfile-API
File metadata and controls
43 lines (31 loc) · 1.52 KB
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
FROM python:3.12 as dev
WORKDIR /app
COPY simpler-core/ /app/simpler_core
COPY simpler-api /app/simpler_api
COPY simpler-model /app/simpler_model
# COPY simpler-plugin-tabular /app/simpler_plugin_tabular
COPY simpler-plugin-rdf /app/simpler_plugin_rdf
COPY simpler-plugin-sql /app/simpler_plugin_sql
COPY simpler-plugin-xml /app/simpler_plugin_xml
RUN pip wheel --no-deps -w /app/wheels /app/simpler_model
RUN pip wheel --no-deps -w /app/wheels /app/simpler_core
RUN pip wheel --no-deps -w /app/wheels /app/simpler_api
# RUN pip wheel --no-deps -w /app/wheels /app/simpler_plugin_tabular
RUN pip wheel --no-deps -w /app/wheels /app/simpler_plugin_rdf
RUN pip wheel --no-deps -w /app/wheels /app/simpler_plugin_sql
RUN pip wheel --no-deps -w /app/wheels /app/simpler_plugin_xml
FROM python:3.12
WORKDIR /app
COPY --from=dev /app/wheels /app/wheels
# This should find the necessary other modules from the wheel dir
RUN pip install --find-links /app/wheels simpler_api
# We need to perform a hotfix for owlready2 here
RUN sed -i.bak -E "s/(else: +name = )storid/\1str\(storid\)/g" /usr/local/lib/python3.12/site-packages/owlready2/namespace.py
# RUN pip install --find-links /app/wheels simpler_plugin_tabular
RUN pip install --find-links /app/wheels simpler_plugin_rdf
RUN pip install --find-links /app/wheels simpler_plugin_sql
RUN pip install --find-links /app/wheels simpler_plugin_xml
RUN pip install uvicorn
RUN apt-get update
RUN apt-get install -y graphviz
ENTRYPOINT ["uvicorn", "simpler_api.main:app", "--host", "0.0.0.0", "--port", "7373"]