Spaces:
Sleeping
Sleeping
File size: 1,147 Bytes
57a1582 15d20f4 96266ad 0334703 15d20f4 0334703 15d20f4 f002a75 875cede 15d20f4 f002a75 15d20f4 57a1582 15d20f4 57a1582 |
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.10.12
# always create the user first and add
# to avoid the permission issue when editing the files later especially
# if you want to use the dev mode
RUN useradd -m -u 1000 user
# define the directory and install packages
WORKDIR /app
COPY ./packages.txt /app/packages.txt
RUN apt-get update && xargs -r -a packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
# copy the requirements to container and install them
COPY --chown=user ./requirements.txt requirements.txt
RUN pip3 install --no-cache-dir -r requirements.txt
# Copy the current directory contents into the container at /app setting the owner to the user
#COPY --chown=user . /app
COPY --link --chown=1000 ./ /app
# app will need to expose the port for taking browser inputs
# make sure to have same port as mentioned in Readme.md
# rest of the code is from https://huggingface.co/spaces/SpacesExamples/streamlit-docker-example/blob/main/Dockerfile
# sepcific for streamlit docker
EXPOSE 8501
CMD streamlit run app.py \
--server.headless true \
--server.enableCORS false \
--server.enableXsrfProtection false \
--server.fileWatcherType none |