Spaces:
Build error
Build error
File size: 867 Bytes
4b49c1e a49394e 4b49c1e a49394e 4b49c1e a49394e 4b49c1e a49394e 4b49c1e a49394e 4b49c1e |
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 |
FROM python:3.9
WORKDIR /code
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
# Agrega la siguiente línea al final del Dockerfile
ARG NO_CACHE=1
# Cambia la línea COPY por la siguiente:
COPY --from=builder --chown=user:user . $HOME/app
# Agrega el siguiente bloque al final del Dockerfile
RUN if [ "${NO_CACHE:-0}" -eq "1" ]; then echo "Installing dependencies without cache"; fi && pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Agrega las siguientes líneas al final del Dockerfile
ARG USE_ENV_FILE=1
RUN if [ "${USE_ENV_FILE:-0}" -eq "1" ]; then cp /code/.env.local $HOME/app/.env; fi
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |