diff --git a/kontor-robyn/.python-version b/kontor-robyn/.python-version new file mode 100644 index 0000000..24ee5b1 --- /dev/null +++ b/kontor-robyn/.python-version @@ -0,0 +1 @@ +3.13 diff --git a/kontor-robyn/Containerfile b/kontor-robyn/Containerfile new file mode 100644 index 0000000..bb031b5 --- /dev/null +++ b/kontor-robyn/Containerfile @@ -0,0 +1,38 @@ +## ------------------------------- Builder Stage ------------------------------ ## +FROM python:3.13-bookworm AS builder + +RUN apt-get update && apt-get install --no-install-recommends -y build-essential && \ + apt-get clean && rm -rf /var/lib/apt/lists/* + +# Download the latest installer, install it and then remove it +ADD https://astral.sh/uv/install.sh /install.sh +RUN chmod -R 655 /install.sh && /install.sh && rm /install.sh + +# Set up the UV environment path correctly +ENV PATH="/root/.local/bin:${PATH}" + +WORKDIR /app + +COPY ./pyproject.toml . + +RUN uv sync + +# ------------------------------- Production Stage ------------------------------ ## +FROM python:3.13-slim-bookworm AS production + +RUN apt-get update && apt-get install --no-install-recommends -y curl + +WORKDIR /app + +COPY /src src +COPY --from=builder /app/.venv .venv + +# Set up environment variables for production +ENV PATH="/app/.venv/bin:$PATH" + +# Expose the specified port for FastAPI +EXPOSE 8200 + +# Start the application with Uvicorn in production mode, using environment variable references +CMD ["uvicorn", "src.main:kontor", "--log-level", "info", "--host", "0.0.0.0" , "--port", "8200"] + diff --git a/kontor-robyn/README.md b/kontor-robyn/README.md new file mode 100644 index 0000000..e69de29 diff --git a/kontor-robyn/main.py b/kontor-robyn/main.py new file mode 100644 index 0000000..fba05ff --- /dev/null +++ b/kontor-robyn/main.py @@ -0,0 +1,6 @@ +def main(): + print("Hello from kontor-robyn!") + + +if __name__ == "__main__": + main() diff --git a/kontor-robyn/pyproject.toml b/kontor-robyn/pyproject.toml new file mode 100644 index 0000000..cfe9aa3 --- /dev/null +++ b/kontor-robyn/pyproject.toml @@ -0,0 +1,7 @@ +[project] +name = "kontor-robyn" +version = "0.1.0" +description = "Add your description here" +readme = "README.md" +requires-python = ">=3.13" +dependencies = []