Bull / Dockerfile
Thebull's picture
Update Dockerfile
4b49c1e verified
raw
history blame
867 Bytes
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"]