Ask-ANRG / Dockerfile
FloraJ's picture
update
627a746
raw
history blame
947 Bytes
FROM python:3.8
WORKDIR /code
# Upgrade pip
RUN pip install --no-cache-dir --upgrade pip
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# # Install Node.js and npm
# RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \
# && apt-get install -y nodejs
# # Now you can use npm to install packages
# RUN npm install -g marked
# download model from transformer
COPY . .
# Set up a new user named "user" with user ID 1000
RUN useradd -m -u 1000 user
# Switch to the "user" user
USER user
# Set home to the user's home directory
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# Set the working directory to the user's home directory
WORKDIR $HOME/app
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
COPY --chown=user . $HOME/app
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]