Skip to content
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
2 changes: 2 additions & 0 deletions indico-prod/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ services:
# The same image is also used to run celery
indico-web: &indico-web
build: worker
# privileged is ONLY needed if you want to use LaTeX builds
privileged: true
command: /opt/indico/run_indico.sh
depends_on:
- indico-redis
Expand Down
22 changes: 11 additions & 11 deletions indico-prod/worker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@ FROM python:3.12-trixie

ENV INDICO_VIRTUALENV="/opt/indico/.venv" INDICO_CONFIG="/opt/indico/etc/indico.conf"

ARG pip="${INDICO_VIRTUALENV}/bin/pip"
ARG tag="latest"

COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

# create indico user, install apt dependencies as root and setup uwsgi etc.
USER root

RUN set -ex && \
groupadd -r indico && \
useradd -r -g indico -m -d /opt/indico indico

RUN set -ex && \
apt-get update && \
apt-get -y install texlive-xetex libpq-dev postgresql-client vim less gcc gettext libldap2-dev rsync && \
apt-get -y install libpq-dev postgresql-client vim less gcc gettext libldap2-dev rsync podman && \
apt-get clean

RUN set -ex && \
groupadd -r indico && \
useradd -r -g indico -m -d /opt/indico --add-subids-for-system indico

COPY uwsgi.ini /etc/uwsgi.ini
WORKDIR /opt/indico

Expand All @@ -37,15 +38,14 @@ USER indico

RUN set -ex && \
python -m venv ${INDICO_VIRTUALENV} && \
${pip} install --upgrade pip setuptools wheel && \
${pip} install uwsgi
uv pip install uwsgi

RUN if [ "$tag" = "latest" ]; then \
${pip} install indico; \
uv pip install indico; \
else \
${pip} install indico==${tag}; \
uv pip install indico==${tag}; \
fi;
RUN ${pip} install indico-plugins
RUN uv pip install indico-plugins

RUN ${INDICO_VIRTUALENV}/bin/indico setup create-symlinks /opt/indico

Expand Down
8 changes: 8 additions & 0 deletions indico-prod/worker/run_celery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,13 @@ until [ $? -eq 0 ]; do
check_db_ready
done

# Check if latex is used and pull container image
if cat /opt/indico/etc/indico.conf | grep XELATEX_PATH | grep podman && [ "${1:-worker}" == "worker" ]; then
echo 'LaTeX using podman is enabled, pulling container image'
indico maint pull-latex-image
else
echo 'No need to pull container image'
fi

echo 'Starting Celery...'
indico celery ${1:-worker}
9 changes: 9 additions & 0 deletions indico-prod/worker/run_indico.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,14 @@ if [ $? -eq 1 ]; then
indico db prepare
fi

# Check if latex is used and pull container image
echo 'Checking latex config'
if cat /opt/indico/etc/indico.conf | grep XELATEX_PATH | grep podman; then
echo 'LaTeX using podman is enabled, pulling container image'
indico maint pull-latex-image
else
echo 'No need to pull container image'
fi

echo 'Starting Indico...'
uwsgi /etc/uwsgi.ini