Merge modifications for more separate backend functions #69

Open
kscheidecker wants to merge 39 commits from backend/micro-services-restructuring into main
Showing only changes of commit fe1b42fff9 - Show all commits

View File

@@ -1,16 +1,8 @@
FROM python:3.12-slim-bookworm
# use python 3.12 as a base image
FROM docker.io/python:3.12-alpine
# The installer requires curl (and certificates) to download the release archive
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates
# Download the latest installer
ADD https://astral.sh/uv/install.sh /uv-installer.sh
# Run the installer then remove it
RUN sh /uv-installer.sh && rm /uv-installer.sh
# Ensure the installed binary is on the `PATH`
ENV PATH="/root/.local/bin/:$PATH"
# use the latest version of uv, independently of the python version
kscheidecker marked this conversation as resolved Outdated

Is this the way they do it at stadler? 😀
I prefer a different approach:

  1. use a minimal image: -alpine is enough
  2. Import files from the uv docker container - the package is already built there. No need to run the installer, no curl dependencies, etc...

The result looks something like:

# use python 3.12 as a base image
FROM docker.io/python:3.12-alpine
# use the latest version of uv, independently of the python version
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

What do you think?

Is this the way they do it at stadler? 😀 I prefer a different approach: 1. use a minimal image: `-alpine` is enough 2. Import files from the `uv` docker container - the package is already built there. No need to run the installer, no curl dependencies, etc... The result looks something like: ``` # use python 3.12 as a base image FROM docker.io/python:3.12-alpine # use the latest version of uv, independently of the python version COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ ``` What do you think?

Good idea. Changes implemented in commit fe1b42fff9

Good idea. Changes implemented in commit [fe1b42fff9](https://git.kluster.moll.re/anydev/anyway/commit/fe1b42fff918453f5e085907954b75c37ef4a22c)
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
# Set the working directory
WORKDIR /app