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
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.git
.github
.ipython
.jupyter
.pytest_cache
.venv
.vscode
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Dockerfile
LICENSE
11 changes: 5 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ ENV DEBIAN_FRONTEND=noninteractive
# add tini
RUN apt-get update -y && apt-get install -y --no-install-recommends tini git

# Install the project into `/app`
WORKDIR /app

# Enable bytecode compilation
ENV UV_COMPILE_BYTECODE=1

Expand All @@ -27,6 +24,9 @@ ENV UV_NO_DEV=1
# Ensure installed tools can be executed out of the box
ENV UV_TOOL_BIN_DIR=/usr/local/bin

# Install the project into `/app`
WORKDIR /app

# Install the project's dependencies using the lockfile and settings
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
Expand All @@ -46,8 +46,7 @@ ENV PATH="/app/.venv/bin:$PATH"
RUN groupadd --system --gid 999 nonroot \
&& useradd --system --gid 999 --uid 999 --create-home nonroot

COPY --chmod=+x ./scripts/entrypoint.sh /app/
# Use the non-root user to run our application
USER nonroot

# run the command using tini
ENTRYPOINT ["/usr/bin/tini", "--"]
ENTRYPOINT ["./entrypoint.sh"]
26 changes: 26 additions & 0 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
set -euo pipefail

# Ensure at least one argument is provided
if [ "$#" -eq 0 ]; then
echo "Usage: $0 {uniref|uniprot} [args...]"
exit 1
fi

cmd="$1"
shift

case "$cmd" in
uniref)
# Run the uniref pipeline with any additional arguments via tini
exec /usr/bin/tini -- uv run uniref_pipeline "$@"
;;
uniprot)
# Run the uniprot pipeline with any additional arguments via tini
exec /usr/bin/tini -- uv run uniprot_pipeline "$@"
;;
*)
echo "Error: unknown command '$cmd'; valid commands are 'uniref' or 'uniprot'." >&2
exit 1
;;
esac
Loading