alessandro trinca tornidor commited on
Commit
86f85c7
1 Parent(s): 115a227

[feat] try handle FASTAPI_STATIC ARG/ENV variable

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -4
Dockerfile CHANGED
@@ -130,7 +130,11 @@ RUN if [ "${DEPENDENCY_GROUP}" = "fastapi" ]; then if [ ! -d /appnode/dist ]; th
130
 
131
  FROM runtime
132
  ARG FASTAPI_STATIC
133
- RUN mkdir ${FASTAPI_STATIC}
 
 
 
 
134
 
135
  COPY --from=builder_global ${LAMBDA_TASK_ROOT}/sam-quantized/machine_learning_models \
136
  ${LAMBDA_TASK_ROOT}/machine_learning_models
@@ -171,8 +175,13 @@ RUN python -c "import uvicorn"
171
  RUN df -h
172
  RUN ls -l ${LAMBDA_TASK_ROOT}/samgis/
173
  RUN ls -l ${LAMBDA_TASK_ROOT}/wrappers/
174
- RUN ls -l ${FASTAPI_STATIC}/
175
- RUN ls -l ${FASTAPI_STATIC}/dist
176
- RUN ls -l ${FASTAPI_STATIC}/node_modules
 
 
 
 
 
177
 
178
  CMD ["uvicorn", "wrappers.fastapi_wrapper:app", "--host", "0.0.0.0", "--port", "7860"]
 
130
 
131
  FROM runtime
132
  ARG FASTAPI_STATIC
133
+
134
+ RUN echo "show disk space, df -h ..."
135
+ RUN df -h
136
+ RUN echo "creating FASTAPI_STATIC folder: ${FASTAPI_STATIC}, use `mkdir -p` to avoid failure if missing parent folder ..."
137
+ RUN mkdir -p ${FASTAPI_STATIC}
138
 
139
  COPY --from=builder_global ${LAMBDA_TASK_ROOT}/sam-quantized/machine_learning_models \
140
  ${LAMBDA_TASK_ROOT}/machine_learning_models
 
175
  RUN df -h
176
  RUN ls -l ${LAMBDA_TASK_ROOT}/samgis/
177
  RUN ls -l ${LAMBDA_TASK_ROOT}/wrappers/
178
+ RUN echo "LAMBDA_TASK_ROOT /static/:"
179
+ RUN ls -l ${LAMBDA_TASK_ROOT}/static/ || true
180
+ RUN ls -l ${LAMBDA_TASK_ROOT}/static/dist || true
181
+ RUN ls -l ${LAMBDA_TASK_ROOT}/static/node_modules || true
182
+ RUN echo "FASTAPI_STATIC:"
183
+ RUN ls -l ${FASTAPI_STATIC}/ || true
184
+ RUN ls -l ${FASTAPI_STATIC}/dist || true
185
+ RUN ls -l ${FASTAPI_STATIC}/node_modules || true
186
 
187
  CMD ["uvicorn", "wrappers.fastapi_wrapper:app", "--host", "0.0.0.0", "--port", "7860"]