-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
20 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,35 @@ | ||
FROM python:3.11.4-slim-bullseye | ||
FROM python:3.11.4-bullseye as builder | ||
|
||
LABEL maintainer="NSGI <[email protected]>" | ||
|
||
COPY . /src | ||
|
||
# ignore pip warning about running pip as root - since we are in a containerized sandboxed environment anyways... | ||
ENV ENV PIP_ROOT_USER_ACTION=ignore | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
moreutils \ | ||
curl \ | ||
git && \ | ||
pip install --upgrade setuptools && \ | ||
WORKDIR /src | ||
|
||
RUN pip install --upgrade setuptools && \ | ||
pip install --upgrade pip && \ | ||
pip install /src | ||
pip install --upgrade build && \ | ||
python -m build | ||
|
||
# TODO: investigate how to properly setup Dockerfile for production use | ||
WORKDIR /tifs | ||
|
||
RUN cd /usr/local/lib/python3.11/site-packages/pyproj/proj_dir/share/proj && \ | ||
curl -o nl_nsgi_nlgeo2018.tif https://cdn.proj.org/nl_nsgi_nlgeo2018.tif && \ | ||
RUN curl -o nl_nsgi_nlgeo2018.tif https://cdn.proj.org/nl_nsgi_nlgeo2018.tif && \ | ||
curl -o nl_nsgi_rdcorr2018.tif https://cdn.proj.org/nl_nsgi_rdcorr2018.tif && \ | ||
curl -o nl_nsgi_rdtrans2018.tif https://cdn.proj.org/nl_nsgi_rdtrans2018.tif | ||
|
||
|
||
FROM python:3.11.4-slim-bullseye as runner | ||
|
||
ENV ENV PIP_ROOT_USER_ACTION=ignore | ||
|
||
COPY --from=builder /src/dist/coordinate_transformation_api-2*.whl . | ||
|
||
RUN pip install coordinate_transformation_api-2*.whl | ||
|
||
COPY --from=builder /tifs/* /usr/local/lib/python3.11/site-packages/pyproj/proj_dir/share/proj | ||
|
||
EXPOSE 8000 | ||
ENTRYPOINT [ "ct-api" ] |