-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HARMONY-166: Remove multistage Docker build due to lack of CI/CD support
- Loading branch information
Showing
1 changed file
with
3 additions
and
12 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,29 +1,20 @@ | ||
# Debian-based Python. Builds _significantly_ faster than alpine due to presence of pre-built binaries for most libs | ||
FROM python:3.7.4-slim as base | ||
FROM python:3.7.4-slim | ||
|
||
WORKDIR "/home" | ||
|
||
# Multistage build https://docs.docker.com/develop/develop-images/multistage-build/ | ||
# "builder" will have the ability to build dependencies. "base" will be the actual image | ||
FROM base as builder | ||
|
||
# Install static things necessary for building dependencies. | ||
RUN pip3 install --upgrade pip | ||
RUN apt-get update && apt-get install -y build-essential | ||
RUN pip3 install cython | ||
|
||
# First run pip install against requirements.txt. These take a while and are less likely to change than the service lib | ||
COPY requirements/core.txt requirements/core.txt | ||
RUN pip3 install --prefix='/install' --no-warn-script-location -r requirements/core.txt | ||
RUN pip3 install -r requirements/core.txt | ||
|
||
# Copy and install the service lib and its dependencies. | ||
COPY deps deps | ||
RUN pip3 install --prefix='/install' --no-warn-script-location deps/harmony-service-lib-py | ||
|
||
# Main image. Copy built dependencies and local files | ||
FROM base | ||
RUN pip3 install deps/harmony-service-lib-py | ||
|
||
COPY --from=builder /install /usr/local | ||
COPY . . | ||
|
||
ENTRYPOINT ["python3", "-m", "harmony_netcdf_to_zarr"] |