Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
2134268
(Bump deps to) allow colormaps to work (#228)
dmannarino Oct 6, 2025
1c1b59b
Creating titiler route/handler for integrated disturbance alerts.
danscales Sep 21, 2025
bfff67f
Merge pull request #233 from wri/intdist
danscales Oct 7, 2025
48acf9b
Merge branch 'production' into staging
dmannarino Oct 8, 2025
2d8ffe3
Switch to using actual gfw_integrated_dist_alerts dataset
danscales Nov 4, 2025
5de0a4c
GTC-3357 Add forest filter to gfw_integrated_dist_alerts titiler endp…
danscales Nov 7, 2025
38c01bc
Force delete ECR repos, but only in dev (#237)
dmannarino Nov 25, 2025
e588b0a
Merge down changes (#238)
dmannarino Nov 25, 2025
0598680
Merge branch 'dev' into staging
dmannarino Nov 25, 2025
15630cc
Convert to uv; upgrade base image, Python, PostgreSQL (#229)
dmannarino Dec 5, 2025
a8e8e1d
Merge branch 'production' into staging
dmannarino Dec 8, 2025
2214715
Revert "Convert to uv; upgrade base image, Python, PostgreSQL (#229)"…
dmannarino Dec 10, 2025
a5d4c27
Change our use of str Enum classes to be compatible with Python 3.11 …
dmannarino Dec 16, 2025
3642a0e
Make sure to apply tree cover filter for encoded int-dist alerts (#248)
danscales Dec 17, 2025
a541c20
Convert to UV; upgrade Python to 3.11 (now with compatibility!) (#247)
dmannarino Dec 29, 2025
07632e7
Add catching ExceptionGroups
dmannarino Dec 31, 2025
650411b
Revert "Add catching ExceptionGroups"
dmannarino Jan 6, 2026
41bfa4f
Merge branch 'production' into staging
dmannarino Jan 6, 2026
a003694
Remove Planet routes (#255)
dmannarino Jan 6, 2026
73c9f1d
Get lambda layer and core infra values from SSM (Parameter Store) (#236)
dmannarino Dec 18, 2025
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: 0 additions & 1 deletion .github/workflows/terraform_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_dev }}
AWS_REGION: ${{ secrets.aws_region_dev }}
LOCALSTACK_AUTH_TOKEN: ${{ secrets.localstack_auth_token }}
PLANET_API_KEY: ${{secrets.planet_api_key }}
run: |
./scripts/test

Expand Down
131 changes: 103 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,115 @@
FROM --platform=linux/amd64 tiangolo/uvicorn-gunicorn-fastapi:python3.10-slim
# Note that this ENV is the name of an argument/variable, not the Dockerfile ENV command
ARG ENV
ARG PYTHON_VERSION="3.11"
ARG USR_LOCAL_BIN=/usr/local/bin
ARG UV_VERSION="0.9.11"
ARG VENV_DIR=/app/.venv

FROM --platform=linux/amd64 ubuntu:noble AS build

# Optional build argument for different environments
ARG ENV
ARG PYTHON_VERSION
ARG USR_LOCAL_BIN
ARG UV_VERSION
ARG VENV_DIR

RUN apt-get -y update && apt-get -y --no-install-recommends install \
make gcc libc-dev libgeos-dev musl-dev libpq-dev libffi-dev jq openssh-client
RUN apt-get -qy update && \
apt-get install -qy --no-install-recommends --no-install-suggests \
ca-certificates \
curl \
gcc \
jq \
libc-dev \
libgeos-dev \
libpq-dev \
libffi-dev \
make \
openssh-client

RUN pip install --upgrade pip && pip install pipenv==v2022.11.30
RUN pip install newrelic
# Set uv env variables for behavior and venv directory
ENV PATH=${USR_LOCAL_BIN}:${PATH} \
UV_LINK_MODE=copy \
UV_COMPILE_BYTECODE=1 \
UV_PROJECT_ENVIRONMENT=${VENV_DIR} \
UV_UNMANAGED_INSTALL=${USR_LOCAL_BIN}

COPY Pipfile Pipfile
COPY Pipfile.lock Pipfile.lock
# Create a virtual environment with uv inside the container
RUN curl -LsSf https://github.com/astral-sh/uv/releases/download/${UV_VERSION}/uv-installer.sh | sh && \
uv venv ${VENV_DIR} --python ${PYTHON_VERSION} --seed

# Copy pyproject.toml and uv.lock to a temporary directory and install
# dependencies into the venv
COPY pyproject.toml /_lock/
COPY uv.lock /_lock/
RUN if [ "$ENV" = "dev" ] || [ "$ENV" = "test" ]; then \
echo "Install all dependencies" && \
apt-get install -y --no-install-recommends git postgresql-client lsb-release && \
pipenv install --system --deploy --ignore-pipfile --dev && \
apt-get install -y --no-install-recommends apt-transport-https ca-certificates curl gnupg && \
curl -fsSL https://apt.releases.hashicorp.com/gpg | gpg --dearmor > /usr/share/keyrings/hashicorp-archive-keyring.gpg && \
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" > /etc/apt/sources.list.d/hashicorp.list && \
apt-get update && apt-get install -y --no-install-recommends terraform=0.13.3; \
else \
echo "Install production dependencies only" && \
pipenv install --system --deploy; \
fi

RUN apt-get clean \
&& rm -rf /var/lib/apt/lists/*
echo "Install all dependencies" && \
cd /_lock && \
uv sync --locked --no-install-project --dev; \
else \
echo "Install production dependencies only" && \
cd /_lock && \
uv sync --locked --no-install-project --no-dev; \
fi

# Start the runtime stage
FROM --platform=linux/amd64 ubuntu:noble

ARG ENV
ARG USR_LOCAL_BIN
ARG VENV_DIR

SHELL ["sh", "-exc"]

ENV DEV_PKGS="curl git postgresql-client lsb-release apt-transport-https ca-certificates gnupg"

RUN if [ "$ENV" = "dev" ] || [ "$ENV" = "test" ]; then \
echo "Install terraform and dev dependencies" && \
apt-get -qy update && \
apt-get install -qy --no-install-recommends ${DEV_PKGS} && \
curl -fsSL https://apt.releases.hashicorp.com/gpg | gpg --dearmor > /usr/share/keyrings/hashicorp-archive-keyring.gpg && \
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" > /etc/apt/sources.list.d/hashicorp.list && \
apt-get update && \
apt-get install -y --no-install-recommends terraform=0.13.3 && \
apt-get clean && \
rm -rf /var/lib/apt/lists && \
rm -rf /var/cache/apt; \
else \
echo "Skipping terraform and dev dependencies"; \
apt-get clean && \
rm -rf /var/lib/apt/lists && \
rm -rf /var/cache/apt; \
fi

ENV PATH=${VENV_DIR}/bin:${USR_LOCAL_BIN}:${PATH}
ENV TZ=UTC
ENV VENV_DIR=${VENV_DIR}

RUN echo $TZ > /etc/timezone

RUN apt-get update -qy && \
apt-get install -qyy \
-o APT::Install-Recommends=false \
-o APT::Install-Suggests=false \
expat \
jq \
postgresql-client && \
apt-get clean && \
rm -rf /var/lib/apt/lists && \
rm -rf /var/cache/apt

COPY --chmod=777 wait_for_postgres.sh /usr/local/bin/wait_for_postgres.sh

# Copy the pre-built `/app` directory from the build stage
COPY --from=build --chmod=777 /app /app
COPY --from=build --chmod=777 /root /root

COPY ./app /app/app
COPY wait_for_postgres.sh /usr/local/bin/wait_for_postgres.sh
COPY app/settings/start.sh /app/start.sh
COPY newrelic.ini /app/newrelic.ini

RUN chmod +x /usr/local/bin/wait_for_postgres.sh
COPY --chmod=777 app/settings/gunicorn_conf.py /app/gunicorn_conf.py
COPY --chmod=777 app/settings/start.sh /app/start.sh

COPY ./app /app/app

RUN chmod +x /app/start.sh
WORKDIR /app

ENTRYPOINT [ "/app/start.sh" ]
ENTRYPOINT [ "/app/start.sh" ]
53 changes: 0 additions & 53 deletions Pipfile

This file was deleted.

Loading