Skip to content

Commit

Permalink
chore: update entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
jaluma committed Aug 12, 2024
1 parent fabc3f6 commit f73a36a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# Ensure correct ownership of the local_data directory
chown -R worker /home/worker/app/local_data

# Ensure correct ownership of the models directory if it exists
if [ -d "/home/worker/app/models" ]; then
chown -R worker /home/worker/app/models
fi

# Execute the command passed to the entrypoint
exec "$@"
8 changes: 7 additions & 1 deletion Dockerfile.llamacpp-cpu
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,11 @@ COPY --chown=worker private_gpt/ private_gpt
COPY --chown=worker *.yaml .
COPY --chown=worker scripts/ scripts

# Copy the entrypoint script and set correct permissions
COPY ./.docker/entrypoint.sh /entrypoint.sh
RUN chown worker /entrypoint.sh && \
chmod +x /entrypoint.sh

USER worker
ENTRYPOINT python -m private_gpt
ENTRYPOINT ["/entrypoint.sh"]
CMD ["python", "-m", "private_gpt"]
8 changes: 7 additions & 1 deletion Dockerfile.ollama
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,11 @@ COPY --chown=worker private_gpt/ private_gpt
COPY --chown=worker *.yaml .
COPY --chown=worker scripts/ scripts

# Copy the entrypoint script and set correct permissions
COPY ./.docker/entrypoint.sh /entrypoint.sh
RUN chown worker /entrypoint.sh && \
chmod +x /entrypoint.sh

USER worker
ENTRYPOINT python -m private_gpt
ENTRYPOINT ["/entrypoint.sh"]
CMD ["python", "-m", "private_gpt"]

0 comments on commit f73a36a

Please sign in to comment.