diff --git a/docker-image/Dockerfile b/docker-image/Dockerfile new file mode 100644 index 0000000..d062d3a --- /dev/null +++ b/docker-image/Dockerfile @@ -0,0 +1,16 @@ +ARG BASE_IMAGE=python:${PYTHON_VERSION} + +FROM ${BASE_IMAGE} as base + +RUN apt-get update \ + && apt-get install --no-install-recommends -y cmake \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /nlp_profiler + +COPY . . + +RUN pip install --no-cache-dir -r requirements-dev.txt \ + && pip install --no-cache-dir -r requirements.txt \ + && pip install --no-cache-dir -r requirements-nix-dev.txt \ No newline at end of file diff --git a/docker-image/run-nlp-profiler-in-docker.sh b/docker-image/run-nlp-profiler-in-docker.sh new file mode 100755 index 0000000..5180f16 --- /dev/null +++ b/docker-image/run-nlp-profiler-in-docker.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +set -e +set -u +set -o pipefail + +PYTHON_VERSION=${1:-"3.8"} + +MOUNT_VOLUME="${PWD}/../" +TARGET_FOLDER="/nlp_profiler" +DOCKER_IMAGE_NAME="nlp_profiler" + +echo "~~~ Running nlp_profiler in a docker container" +echo "Docker image name: ${DOCKER_IMAGE_NAME}" +echo "Mounted volume: ${MOUNT_VOLUME}" +echo "Target folder: ${TARGET_FOLDER}" + +echo "~~~ Building docker image ${DOCKER_IMAGE_NAME} with Python version ${PYTHON_VERSION}." +docker build -t ${DOCKER_IMAGE_NAME} --build-arg python_version="${PYTHON_VERSION}" ../ + +echo "~~~ Running docker container ${DOCKER_IMAGE_NAME}." +docker run -it \ + --volume "${MOUNT_VOLUME}":${TARGET_FOLDER} \ + --workdir ${TARGET_FOLDER} \ + ${DOCKER_IMAGE_NAME} \ + /bin/bash + +echo "~~~ Exited docker container." \ No newline at end of file