Skip to content

Commit 138d9b5

Browse files
committed
Added non-root user for container.
1 parent 6c3bf25 commit 138d9b5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,17 @@ COPY LICENSE LICENSE
2626
RUN python -m pip install --no-cache-dir --upgrade .["psycopg-binary"]
2727
RUN rm -rf titiler/ pyproject.toml README.md LICENSE
2828

29+
RUN groupadd -g 1000 user && \
30+
useradd -u 1000 -g user -s /bin/bash -m user
31+
32+
USER user
33+
2934
###################################################
3035
# For compatibility (might be removed at one point)
3136
ENV MODULE_NAME=titiler.pgstac.main
3237
ENV VARIABLE_NAME=app
3338
ENV HOST=0.0.0.0
3439
ENV PORT=80
3540
ENV WEB_CONCURRENCY=1
41+
3642
CMD gunicorn -k uvicorn.workers.UvicornWorker ${MODULE_NAME}:${VARIABLE_NAME} --bind ${HOST}:${PORT} --workers ${WEB_CONCURRENCY}

0 commit comments

Comments
 (0)