Skip to content

Commit

Permalink
Collect setup.py after API and src code is copied to docker stage
Browse files Browse the repository at this point in the history
I won't mind installing source python package after code changes
  • Loading branch information
kshitijrajsharma authored Jun 5, 2024
1 parent 16e5460 commit b660c6f
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,12 @@ RUN apt-get update \
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN gdal-config --version | awk -F'[.]' '{print $1"."$2}'

COPY setup.py .
COPY pyproject.toml .
COPY requirements.txt .
COPY README.md .
COPY LICENSE .

RUN pip install --user --no-cache-dir --upgrade pip setuptools wheel\
&& pip install --user --no-cache-dir GDAL=="$(gdal-config --version)" \
&& pip install --user --no-cache-dir -r requirements.txt

RUN python setup.py install


FROM with-tippecanoe as prod
COPY --from=python-builder /root/.local /home/appuser/.local

Expand All @@ -63,7 +56,7 @@ RUN useradd --system --uid 900 --home-dir /home/appuser --shell /bin/false appus

USER appuser

# API and source code, changes here don't invalidate previous layers , You can overwrite this block with -v
# API and source code, changes here don't invalidate previous layers

# Copy config.txt if you have your configuration setup in config
# COPY config.txt .
Expand All @@ -73,4 +66,6 @@ COPY pyproject.toml .
COPY API/ ./API/
COPY src/ ./src/

RUN python setup.py install --user

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

0 comments on commit b660c6f

Please sign in to comment.