File size: 1,575 Bytes
424ca6b
0f9c611
 
6abf74d
e3fdb01
6abf74d
 
e3fdb01
 
 
 
0f9c611
 
6abf74d
aa983ad
e3fdb01
6abf74d
e3fdb01
 
 
0f9c611
 
 
50d657b
 
0f9c611
 
6abf74d
 
 
 
0f9c611
 
 
 
 
 
50d657b
0f9c611
e3fdb01
6abf74d
 
 
0f9c611
e3fdb01
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
FROM registry.gitlab.com/aletrn/gis-prediction:1.7.0

# Include global arg in this stage of the build
ARG WORKDIR_ROOT="/var/task"
ENV PYTHONPATH="${WORKDIR_ROOT}:${PYTHONPATH}:/usr/local/lib/python3/dist-packages"
ENV VIRTUAL_ENV=${WORKDIR_ROOT}/.venv \
    PATH="${WORKDIR_ROOT}/.venv/bin:$PATH"
ENV WRITE_TMP_ON_DISK=""
ENV MOUNT_GRADIO_APP=""
ENV VITE__STATIC_INDEX_URL="/static"
ENV VITE__INDEX_URL="/"

# Set working directory to function root directory
WORKDIR ${WORKDIR_ROOT}

COPY app.py ${WORKDIR_ROOT}/
COPY pyproject.toml poetry.lock README.md ${WORKDIR_ROOT}
# RUN . ${WORKDIR_ROOT}/.venv && which python && echo "# install samgis #" && pip install .
RUN if [ "${WRITE_TMP_ON_DISK}" != "" ]; then mkdir {WRITE_TMP_ON_DISK}; fi
RUN if [ "${WRITE_TMP_ON_DISK}" != "" ]; then ls -l {WRITE_TMP_ON_DISK}; fi

RUN ls -l /usr/bin/which
RUN /usr/bin/which python
RUN python --version
RUN pip list
RUN echo "PYTHONPATH: ${PYTHONPATH}."
RUN echo "PATH: ${PATH}."
RUN echo "WORKDIR_ROOT: ${WORKDIR_ROOT}."
RUN ls -l ${WORKDIR_ROOT}
RUN ls -ld ${WORKDIR_ROOT}
RUN ls -l ${WORKDIR_ROOT}/machine_learning_models
RUN python -c "import sys; print(sys.path)"
RUN python -c "import fastapi"
RUN python -c "import geopandas"
RUN python -c "import onnxruntime"
RUN python -c "import rasterio"
RUN python -c "import uvicorn"
RUN python -c "import jinja2"
RUN df -h
RUN ls -l ${WORKDIR_ROOT}/app.py
RUN ls -l ${WORKDIR_ROOT}/static/
RUN ls -l ${WORKDIR_ROOT}/static/dist
RUN ls -l ${WORKDIR_ROOT}/static/node_modules

CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]