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
1 change: 1 addition & 0 deletions .github/workflows/pr-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- '.dockerignore'
- '.github/workflows/**'
- 'pyproject.toml'
- 'Dockerfile'

permissions:
contents: read
Expand Down
34 changes: 24 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
FROM ubuntu:latest

RUN apt-get update && apt-get install -y --no-install-recommends git curl ca-certificates r-base build-essential libxml2 libxml2-dev libfontconfig1-dev libtiff-dev libcurl4-openssl-dev libsodium-dev python3.12 python3.12-venv python3-pip
FROM ubuntu:24.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends \
git \
curl \
ca-certificates \
r-base \
build-essential \
libxml2-dev \
libfontconfig1-dev \
libtiff-dev \
libcurl4-openssl-dev \
libsodium-dev \
python3 \
python3-venv \
python3-pip \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /server

Expand All @@ -11,27 +27,25 @@ ENV PATH="/root/.local/bin/:$PATH"

# Install R dependencies
RUN R -e "install.packages('renv', repos = c(CRAN = 'https://cloud.r-project.org'))"

COPY renv.lock renv.lock
RUN mkdir -p renv
COPY .Rprofile .Rprofile
COPY renv/activate.R renv/activate.R
COPY renv/settings.json renv/settings.json
RUN R -e "renv::restore()"

# Install python dependencies
# Python deps
COPY pyproject.toml uv.lock ./
RUN uv venv .venv
RUN uv sync --frozen --no-install-project

# Copy project files
# Copy project
COPY . .

# Install the app
# Install app
RUN uv pip install -e .

# Expose port
EXPOSE 80

# Start the server
CMD uv run hydroshift/add_analytics.py && uv run streamlit run hydroshift/streamlit_app.py \
--server.port=80 --server.address=0.0.0.0 --server.headless=true
CMD ["bash", "-c", "uv run hydroshift/add_analytics.py && uv run streamlit run hydroshift/streamlit_app.py --server.port=80 --server.address=0.0.0.0 --server.headless=true"]
Loading