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
38 changes: 19 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,6 @@ COPY . /app
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --locked

# Download data to be baked in if no data present
ARG DATA=""
ARG EXTRAS=""
RUN set -eux; \
if [ -d "data" ]; then \
echo "Using existing data directory - skip download from Zenodo"; \
elif [ -n "$DATA" ] && [ -n "$EXTRAS" ]; then \
echo "Downloading data from Zenodo records $DATA and $EXTRAS"; \
uv run python scripts/prepare_data.py "$DATA" "$EXTRAS" ; \
uv run python -m scripts.create_db ; \
else \
echo "No data directory found and no $DATA and $EXTRAS provided"; \
echo " Either populate ./data or pass --build-arg $DATA=..." "$EXTRAS"; \
exit 1; \
fi

FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive

Expand Down Expand Up @@ -69,11 +53,27 @@ ENV PATH="/app/.venv/bin:$PATH"
# Prevent Python from writing .pyc files
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1

# Use the non-root user to run our application
USER nonroot

# Use `/app` as the working directory
WORKDIR /app

# Download data to be baked in if no data present
ARG DATA=""
ARG EXTRAS=""
RUN set -eux; \
if [ -d "data" ]; then \
echo "Using existing data directory - skip download from Zenodo"; \
elif [ -n "$DATA" ] && [ -n "$EXTRAS" ]; then \
echo "Downloading data from Zenodo records $DATA and $EXTRAS"; \
python scripts/prepare_data.py "$DATA" "$EXTRAS" ; \
python -m scripts.create_db ; \
else \
echo "No data directory found and no $DATA and $EXTRAS provided"; \
echo " Either populate ./data or pass --build-arg $DATA=..." "$EXTRAS"; \
exit 1; \
fi

# Use the non-root user to run our application
USER nonroot

# Run the FastAPI application by default
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--proxy-headers", "--forwarded-allow-ips=*"]
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "mite_web"
version = "2.0.0.beta.13"
version = "2.0.0.beta.14"
description = "MITE (Minimum Information about a Tailoring Enzyme) Database Web App"
readme = "README.md"
requires-python = ">=3.12.0,<3.13.0" # because of rdkit 2024 in mite_extras
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.