-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from danielfromearth/feature/issue-7-create-wo…
…rking-docker-image Added Docker folder and Readme file
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
FROM python:3.10-slim | ||
|
||
RUN apt-get update \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get upgrade -y \ | ||
gcc \ | ||
libnetcdf-dev \ | ||
libhdf5-dev \ | ||
hdf5-helpers \ | ||
&& pip3 install --upgrade pip \ | ||
&& pip3 install cython \ | ||
&& apt-get clean | ||
|
||
# Create a new user | ||
RUN adduser --quiet --disabled-password --shell /bin/sh --home /home/dockeruser --gecos "" --uid 1000 dockeruser | ||
USER dockeruser | ||
ENV HOME /home/dockeruser | ||
ENV PYTHONPATH "${PYTHONPATH}:/home/dockeruser/.local/bin" | ||
ENV PATH="/home/dockeruser/.local/bin:${PATH}" | ||
|
||
# The 'SOURCE' argument is what will be used in 'pip install'. | ||
ARG SOURCE | ||
|
||
# Set this argument if running the pip install on a local directory, so | ||
# the local dist files are copied into the container. | ||
ARG DIST_PATH | ||
|
||
USER root | ||
RUN mkdir -p /worker && chown dockeruser /worker | ||
USER dockeruser | ||
WORKDIR /worker | ||
|
||
COPY --chown=dockeruser $DIST_PATH $DIST_PATH | ||
USER dockeruser | ||
RUN pip3 install --no-cache-dir --force --user --index-url https://pypi.org/simple/ --extra-index-url https://test.pypi.org/simple/ $SOURCE \ | ||
&& rm -rf $DIST_PATH | ||
|
||
# Run the Batchee Harmony service | ||
ENTRYPOINT ["batchee_harmony"] |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Batchee Service Docker Image | ||
|
||
This directory contains the `Dockerfile` used to build the Docker image capable of running the Batchee service. | ||
|
||
## Building | ||
|
||
The docker image is setup to install the Batchee project into userspace using pip. It will look | ||
in both PyPi and TestPyPi indexes unless building from a local wheel file. |