alessandro trinca tornidor commited on
Commit
268865d
·
1 Parent(s): 7080d8f

ci: docker, stop using CMD with bash scripts, execute directly venv activation then uvicorn app:app

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -8
Dockerfile CHANGED
@@ -36,8 +36,6 @@ RUN git clone https://huggingface.co/spaces/aletrn/samgis-lisa-on-cuda ${LAMBDA_
36
  cp ${LAMBDA_TASK_ROOT}/samgis-lisa-on-cuda/pyproject.toml ${LAMBDA_TASK_ROOT}/pyproject.toml && \
37
  ls -l ${LAMBDA_TASK_ROOT}/samgis-lisa-on-cuda/poetry.lock && \
38
  cp ${LAMBDA_TASK_ROOT}/samgis-lisa-on-cuda/poetry.lock ${LAMBDA_TASK_ROOT}/poetry.lock
39
- COPY ${LAMBDA_TASK_ROOT}/samgis-lisa-on-cuda/docker_entrypoint.sh ${LAMBDA_TASK_ROOT}
40
- COPY ${LAMBDA_TASK_ROOT}/samgis-lisa-on-cuda/entrypoint.sh ${LAMBDA_TASK_ROOT}
41
  RUN ls -l /etc/apt/preferences ${LAMBDA_TASK_ROOT}/pyproject.toml
42
  RUN add-apt-repository "deb http://archive.ubuntu.com/ubuntu jammy main universe restricted multiverse" && \
43
  add-apt-repository "deb http://archive.ubuntu.com/ubuntu jammy-security main universe restricted multiverse" && \
@@ -168,10 +166,6 @@ ENV IS_AWS_LAMBDA=""
168
  # Set working directory to function root directory
169
  WORKDIR ${LAMBDA_TASK_ROOT}
170
 
171
- RUN chmod +x ${LAMBDA_TASK_ROOT}/entrypoint.sh
172
- RUN chmod +x ${LAMBDA_TASK_ROOT}/docker_entrypoint.sh
173
- RUN ls -l ${LAMBDA_TASK_ROOT}/entrypoint.sh ${LAMBDA_TASK_ROOT}/docker_entrypoint.sh
174
-
175
  RUN ls -l /usr/bin/which
176
  RUN /usr/bin/which python
177
  RUN python --version
@@ -199,5 +193,13 @@ RUN echo "FASTAPI_STATIC:"
199
  RUN ls -l ${FASTAPI_STATIC}/ || true
200
  RUN ls -l ${FASTAPI_STATIC}/dist || true
201
  RUN ls -l ${FASTAPI_STATIC}/node_modules || true
202
-
203
- CMD ["/var/task/docker_entrypoint.sh"]
 
 
 
 
 
 
 
 
 
36
  cp ${LAMBDA_TASK_ROOT}/samgis-lisa-on-cuda/pyproject.toml ${LAMBDA_TASK_ROOT}/pyproject.toml && \
37
  ls -l ${LAMBDA_TASK_ROOT}/samgis-lisa-on-cuda/poetry.lock && \
38
  cp ${LAMBDA_TASK_ROOT}/samgis-lisa-on-cuda/poetry.lock ${LAMBDA_TASK_ROOT}/poetry.lock
 
 
39
  RUN ls -l /etc/apt/preferences ${LAMBDA_TASK_ROOT}/pyproject.toml
40
  RUN add-apt-repository "deb http://archive.ubuntu.com/ubuntu jammy main universe restricted multiverse" && \
41
  add-apt-repository "deb http://archive.ubuntu.com/ubuntu jammy-security main universe restricted multiverse" && \
 
166
  # Set working directory to function root directory
167
  WORKDIR ${LAMBDA_TASK_ROOT}
168
 
 
 
 
 
169
  RUN ls -l /usr/bin/which
170
  RUN /usr/bin/which python
171
  RUN python --version
 
193
  RUN ls -l ${FASTAPI_STATIC}/ || true
194
  RUN ls -l ${FASTAPI_STATIC}/dist || true
195
  RUN ls -l ${FASTAPI_STATIC}/node_modules || true
196
+ RUN ls -ld ${LAMBDA_TASK_ROOT}/
197
+ RUN ls -lA ${LAMBDA_TASK_ROOT}/
198
+ RUN ls -l ${LAMBDA_TASK_ROOT}/.venv
199
+ RUN ls -l ${LAMBDA_TASK_ROOT}/.venv/bin/activate
200
+
201
+ # CMD ["/var/task/docker_entrypoint.sh"]
202
+ CMD [
203
+ "source", "/var/task/.venv/bin/activate", "&&",
204
+ "uvicorn", "app:app", "--host","0.0.0.0", "--port", "7860"
205
+ ]