Skip to content

Commit

Permalink
Change user to root
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijrajsharma committed Nov 22, 2023
1 parent e21154e commit c33b082
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ COPY config.txt.sample ./config.txt
COPY setup.py .
COPY API/ ./API/
COPY src/ ./src/
COPY test.geojson ./test.geojson

# Change ownership to root for relevant directories and files
USER root
RUN chown -R root:root /home/appuser

# Use a separate stage to pull the tippecanoe image
FROM ghcr.io/hotosm/tippecanoe:main as tippecanoe-builder

Expand All @@ -54,10 +60,5 @@ FROM runner as prod
COPY --from=tippecanoe-builder /usr/local/bin/tippecanoe* /usr/local/bin/
COPY --from=tippecanoe-builder /usr/local/bin/tile-join /usr/local/bin/

RUN useradd --system --uid 900 --home-dir /home/appuser --shell /bin/false appuser \
&& chown -R appuser:appuser /home/appuser

USER appuser

# CMD ["/bin/bash"]
CMD ["uvicorn", "API.main:app", "--reload", "--host", "0.0.0.0", "--port", "8000", "--no-use-colors", "--proxy-headers"]

0 comments on commit c33b082

Please sign in to comment.