Skip to content

Commit 0e5558a

Browse files
committed
Added non-root user for container.
1 parent 0fc5d46 commit 0e5558a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CHANGES.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## [Unreleased]
44

5+
### Changed
6+
7+
- Docker container runs as non-root user
8+
59
## [6.1.0] - 2025-11-03
610

711
### Changed
@@ -15,7 +19,7 @@
1519

1620
- lower bounds for `hydraters` requirements
1721
- `EXCLUDE_HYDRATE_MARKERS=TRUE/FALSE` (defaults to `TRUE`) to exclude `𒍟※` markers returned by PgSTAC
18-
- python `3.13` and `3.14` support
22+
- python `3.13` and `3.14` support
1923

2024
### removed
2125

Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@ RUN python -m pip install -U pip
1919
WORKDIR /app
2020

2121
COPY stac_fastapi/ stac_fastapi/
22-
COPY pyproject.toml pyproject.toml
22+
COPY pyproject.toml pyproject.toml
2323
COPY README.md README.md
2424

2525
RUN python -m pip install .[server]
2626
RUN rm -rf stac_fastapi .toml README.md
2727

28+
RUN groupadd -g 1000 user && \
29+
useradd -u 1000 -g user -s /bin/bash -m user
30+
USER user
31+
2832
CMD ["uvicorn", "stac_fastapi.pgstac.app:app", "--host", "0.0.0.0", "--port", "8080"]

0 commit comments

Comments
 (0)