From 09453c47c2f99263de36963e157a352fb853048f Mon Sep 17 00:00:00 2001 From: John Wilkie Date: Wed, 14 Aug 2024 21:28:39 +0100 Subject: [PATCH] Added Dockerfile --- Dockerfile | 55 ++++++++++++++++++++++++++++++++++++++++++++++ Dockerfile.develop | 1 - 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 Dockerfile delete mode 100644 Dockerfile.develop diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..ba3ba36cf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,55 @@ +# Use an official Python runtime as a parent image +FROM python:3.10-slim + +# Environment variables +ARG YOUR_ENV + +ENV YOUR_ENV=${YOUR_ENV:-development} \ + PYTHONFAULTHANDLER=1 \ + PYTHONUNBUFFERED=1 \ + PYTHONHASHSEED=random \ + PIP_NO_CACHE_DIR=off \ + PIP_DISABLE_PIP_VERSION_CHECK=on \ + PIP_DEFAULT_TIMEOUT=100 \ + POETRY_VIRTUALENVS_CREATE=false \ + POETRY_NO_INTERACTION=1 + +# Install necessary build tools and dependencies +RUN apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + make \ + build-essential \ + libffi-dev \ + libssl-dev \ + python3-dev \ + curl \ + && rm -rf /var/lib/apt/lists/* + +# Install Poetry in a known location and add to PATH +RUN curl -sSL https://install.python-poetry.org | python3 - \ + && ln -s /root/.local/bin/poetry /usr/local/bin/poetry + +# Set the working directory in the container +WORKDIR /app + +# Copy only pyproject.toml and poetry.lock to cache them in the Docker layer +COPY pyproject.toml poetry.lock /app/ + +# Install the dependencies from pyproject.toml using Poetry +RUN poetry install $(test "$YOUR_ENV" = production && echo "--only=main") --no-interaction --no-ansi + +# Install the darwin-py package and CLI executable using pip +RUN pip install darwin-py + +# The following steps are commented out to allow users to customize the Dockerfile: + +# Copy the rest of the application code (uncomment and modify as needed) +# COPY . /app + +# Expose any necessary ports (uncomment and modify as needed) +# EXPOSE 80 + +# Set an entry point or command (uncomment and modify as needed) +# CMD ["python", "/app/your_main_script.py"] + +# End of Dockerfile diff --git a/Dockerfile.develop b/Dockerfile.develop deleted file mode 100644 index d5d65e229..000000000 --- a/Dockerfile.develop +++ /dev/null @@ -1 +0,0 @@ -FROM python:3 \ No newline at end of file