Skip to content

Commit

Permalink
Fix docker cache image for dev (basetenlabs#1105)
Browse files Browse the repository at this point in the history
* Change model copy dockerfile for improving cache
  • Loading branch information
nicolasgere authored Aug 28, 2024
1 parent 7a7e4ab commit aa2840f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions truss/templates/server.Dockerfile.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,19 @@ COPY ./{{config.data_dir}} /app/data
{%- endif %}

COPY ./server /app
{%- if model_dir_exists %}
COPY ./{{ config.model_module_dir }} /app/model
{%- endif %}

COPY ./config.yaml /app/config.yaml
{%- if config.live_reload %}
COPY ./control /control
RUN python3 -m venv /control/.env \
&& /control/.env/bin/pip3 install -r /control/requirements.txt
{%- endif %}
{%- if model_dir_exists %}
COPY ./{{ config.model_module_dir }} /app/model
{%- endif %}
{% endblock %}


{% block run %}
{%- if config.live_reload %}
ENV HASH_TRUSS {{truss_hash}}
Expand Down
2 changes: 1 addition & 1 deletion truss/test_data/server.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ WORKDIR $APP_HOME
# Copy data before code for better caching
COPY ./data /app/data
COPY ./server /app
COPY ./model /app/model
COPY ./config.yaml /app/config.yaml
COPY ./model /app/model

COPY ./packages /packages

Expand Down

0 comments on commit aa2840f

Please sign in to comment.