Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor rearrangement to fit Serve requirements #4

Merged
merged 9 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-ptp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

env:
REGISTRY: ghcr.io
IMAGE_NAME: 'ptp'
IMAGE_NAME: ${{ github.repository }}
#DOCKER_USER: ${{ secrets.DOCKER_USER }}
#DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
working-directory: ./ptp
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/pharmbio/ptp
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
Expand Down
11 changes: 5 additions & 6 deletions ptp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ FROM djangobase AS djangoapp
COPY . /app/

WORKDIR /app


RUN mkdir /app/inference/models/

# Expose the port the Django app runs on
EXPOSE 8000
Expand All @@ -41,16 +40,16 @@ RUN useradd -u 1000 $USER
RUN chown -R $USER:$USER /etc/supervisor/conf.d/supervisord.conf
RUN chown -R $USER:$USER /app/
RUN chown -R $USER:$USER /var/log/supervisor/
RUN chmod +x /app/start-single.sh
RUN chmod +x /app/start-script.sh
RUN chmod +x /app/start-django.sh
RUN chmod +x /app/download.sh

# Make sure the container is running as non-root
USER $USER

ENV CELERY_BROKER_URL="redis://localhost:6379/0"
ENV REDIS_URL="redis://localhost:6379/0"
ENV DOWNLOAD=false
ENV MODEL_DIR = "/app/inference/models/models"
# Models will be downloaded and placed in /app/inference/models/models through SciLifeLab Serve interface

# Start supervisord
CMD ["sh", "-c", "/app/start-single.sh"]
CMD ["sh", "-c", "/app/start-script.sh"]
9 changes: 0 additions & 9 deletions ptp/download.sh

This file was deleted.

4 changes: 4 additions & 0 deletions ptp/start-script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

sh -c /app/start-django.sh
supervisord -c /etc/supervisor/conf.d/supervisord.conf
8 changes: 0 additions & 8 deletions ptp/start-single.sh

This file was deleted.

Loading