-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
64 lines (53 loc) · 1.79 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
53
54
55
56
57
58
59
60
61
62
63
64
FROM --platform=x86_64 python:3.8 as development
ENV SAP_AHOST=
ENV SAP_SYSNR=
ENV SAP_CLIENT=
ENV SAP_USER=
ENV SAP_PASSWD=
ENV POETRY_VERSION=1.2.0
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python && \
cd /usr/local/bin && \
ln -s /opt/poetry/bin/poetry && \
poetry config virtualenvs.create false
# ================= SAP RFC Configuration ======================
RUN mkdir -p /usr/local/sap
COPY ./sap-nw-sdk.tar.gz .
RUN tar -zxf sap-nw-sdk.tar.gz --directory /usr/local/sap
RUN rm sap-nw-sdk.tar.gz
ENV SAPNWRFC_HOME=/usr/local/sap/nwrfcsdk
RUN echo "/usr/local/sap/nwrfcsdk/lib" > /etc/ld.so.conf.d/nwrfcsdk.conf
RUN ldconfig -v | grep sap
# ==============================================================
COPY ./pyproject.toml ./poetry.lock* /tmp/
WORKDIR /tmp
RUN poetry install --no-root
RUN mkdir -p /app
RUN mkdir -p /data
WORKDIR /app
FROM --platform=x86_64 tiangolo/uvicorn-gunicorn-fastapi:python3.8 as production
ENV SAP_AHOST=
ENV SAP_SYSNR=
ENV SAP_CLIENT=
ENV SAP_USER=
ENV SAP_PASSWD=
ENV POETRY_VERSION=1.2.0
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python && \
cd /usr/local/bin && \
ln -s /opt/poetry/bin/poetry && \
poetry config virtualenvs.create false
# ================= SAP RFC Configuration ======================
RUN mkdir -p /usr/local/sap
COPY ./sap-nw-sdk.tar.gz .
RUN tar -zxf sap-nw-sdk.tar.gz --directory /usr/local/sap
RUN rm sap-nw-sdk.tar.gz
ENV SAPNWRFC_HOME=/usr/local/sap/nwrfcsdk
RUN echo "/usr/local/sap/nwrfcsdk/lib" > /etc/ld.so.conf.d/nwrfcsdk.conf
RUN ldconfig -v | grep sap
# ==============================================================
COPY ./pyproject.toml ./poetry.lock* /tmp/
WORKDIR /tmp
RUN poetry install --no-root --no-dev
COPY ./ /app
RUN mkdir -p /data
WORKDIR /app
EXPOSE 80