From 8860a78436ba872ff75935c7a6dbe2b9b4bc088f Mon Sep 17 00:00:00 2001 From: Michael McGuinness Date: Fri, 1 Nov 2024 13:44:32 +0000 Subject: [PATCH] Merged in feature/fieldExtractionDockerfile (pull request #254) Create Dockerfile * dockerfile * noreadme * Merged main into feature/fieldExtractionDockerfile Approved-by: Alex Galarce --- fieldExtraction/README.md | 1 + fieldExtraction/release/Dockerfile | 26 ++++++++++++++++++++++++++ release/Dockerfile | 1 - 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 fieldExtraction/README.md create mode 100644 fieldExtraction/release/Dockerfile diff --git a/fieldExtraction/README.md b/fieldExtraction/README.md new file mode 100644 index 0000000..cfa2fba --- /dev/null +++ b/fieldExtraction/README.md @@ -0,0 +1 @@ +# Field Extraction \ No newline at end of file diff --git a/fieldExtraction/release/Dockerfile b/fieldExtraction/release/Dockerfile new file mode 100644 index 0000000..08ddfd8 --- /dev/null +++ b/fieldExtraction/release/Dockerfile @@ -0,0 +1,26 @@ +# syntax=docker/dockerfile:1 + +ARG PYTHON_VERSION=3.12.7 +FROM python:${PYTHON_VERSION} + +# Prevents Python from writing pyc files. +ENV PYTHONDONTWRITEBYTECODE=1 + +# Keeps Python from buffering stdout and stderr to avoid situations where +# the application crashes without emitting any logs due to buffering. +ENV PYTHONUNBUFFERED=1 + +RUN --mount=type=cache,target=/root/.cache/pip \ + python -m pip install poetry + +WORKDIR /app + +COPY pyproject.toml . +COPY poetry.lock . + +RUN --mount=type=cache,target=/root/.cache/pip \ + poetry install --no-dev --compile + +COPY src/ src/ + +CMD [ "poetry", "run", "python", "src/main.py" ] diff --git a/release/Dockerfile b/release/Dockerfile index 51b75e1..cb321cb 100644 --- a/release/Dockerfile +++ b/release/Dockerfile @@ -17,7 +17,6 @@ WORKDIR /app COPY pyproject.toml . COPY poetry.lock . -COPY README.md . RUN --mount=type=cache,target=/root/.cache/pip \ poetry install --no-dev --compile