Skip to content

Commit

Permalink
HARMONY-166: Remove multistage Docker build due to lack of CI/CD support
Browse files Browse the repository at this point in the history
  • Loading branch information
bilts committed Mar 16, 2020
1 parent 2052197 commit aa54c5d
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions Dockerfile
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"]

0 comments on commit aa54c5d

Please sign in to comment.