Skip to content

Commit

Permalink
Better caching (reduces chmode layer -4G)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mins0o committed Dec 24, 2023
1 parent 98f36ad commit a123506
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
24 changes: 10 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,23 @@ ENV TIKTOKEN_CACHE_DIR=/workspace/tiktoken_cache

WORKDIR /workspace

COPY ./docs /workspace/docs
COPY ./requirements.txt /workspace/requirements.txt
COPY ./reqs_optional /workspace/reqs_optional
COPY ./docker_build_script_ubuntu.sh /workspace/docker_build_script_ubuntu.sh
COPY ./Makefile /workspace/Makefile
COPY ./version.txt /workspace/version.txt

RUN cd /workspace && ./docker_build_script_ubuntu.sh

COPY . /workspace/

RUN chmod -R a+rwx /workspace

ARG user=h2ogpt
ARG group=h2ogpt
ARG uid=1000
ARG gid=1000

RUN groupadd -g ${gid} ${group} && useradd -u ${uid} -g ${group} -s /bin/bash ${user}

EXPOSE 7860
COPY --chown=h2ogpt ./docs /workspace/docs
COPY --chown=h2ogpt ./requirements.txt /workspace/requirements.txt
COPY --chown=h2ogpt ./reqs_optional /workspace/reqs_optional
COPY --chown=h2ogpt ./Makefile /workspace/Makefile
COPY --chown=h2ogpt ./version.txt /workspace/version.txt
COPY --chown=h2ogpt ./docker_build_script_ubuntu.sh /workspace/docker_build_script_ubuntu.sh

RUN cd /workspace && ./docker_build_script_ubuntu.sh

COPY --chown=h2ogpt . /workspace/

USER h2ogpt

Expand Down
3 changes: 3 additions & 0 deletions docker_build_script_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ apt-get install -y \
libreoffice \
autoconf \
libtool \
tree \
libtcmalloc-minimal4

# Run upgrades
Expand Down Expand Up @@ -107,3 +108,5 @@ chmod -R a+rwx /workspace/save
# Cleanup
rm -rf /workspace/Miniconda3-py310_23.1.0-1-Linux-x86_64.sh
rm -rf /workspace/.cache/pip

chown -R h2ogpt /workspace

0 comments on commit a123506

Please sign in to comment.