Skip to content

Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!

Python

quality: Docker file code quality

Clémence Lesné79fe891aee7a
diff --git a/.editorconfig b/.editorconfig
index 6e52605..106434c 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -16,3 +16,6 @@ indent_size = 4
[Makefile]
indent_size = 4
indent_style = tab
+
+[Dockerfile]
+indent_size = 4
diff --git a/Makefile b/Makefile
index 85559ef..437e6ac 100644
--- a/Makefile
+++ b/Makefile
@@ -123,9 +123,10 @@ dev:
--workers 2
build:
- $(docker) build \
+ DOCKER_BUILDKIT=1 $(docker) build \
--build-arg VERSION=$(version_full) \
--file cicd/Dockerfile \
+ --platform linux/amd64,linux/arm64 \
--tag $(container_name):$(version_small) \
--tag $(container_name):latest \
.
diff --git a/cicd/Dockerfile b/cicd/Dockerfile
index 7e69d61..8233302 100644
--- a/cicd/Dockerfile
+++ b/cicd/Dockerfile
@@ -6,22 +6,26 @@ FROM base AS build
RUN rm -f /etc/apt/apt.conf.d/docker-clean \
&& echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
-RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked --mount=target=/root/.cache/pip,type=cache,sharing=locked \
- apt-get update -q \
- && apt-get install -y -q --no-install-recommends \
- gcc \
- python3-dev \
- && python3 -m pip install --upgrade \
- pip \
- setuptools \
- wheel
+RUN --mount=target=/var/lib/apt/lists,type=cache,id=apt-lists-${TARGETPLATFORM},sharing=locked --mount=target=/root/.cache/pip,type=cache,id=pip-${TARGETPLATFORM},sharing=locked \
+ apt-get update -q \
+ && apt-get install -y -q --no-install-recommends \
+ gcc \
+ python3-dev \
+ && python3 -m pip \
+ --disable-pip-version-check \
+ --quiet \
+ install \
+ setuptools wheel
RUN python -m venv /venv
ENV PATH=/venv/bin:$PATH
COPY requirements.txt .
-RUN --mount=target=/root/.cache/pip,type=cache,sharing=locked \
- python3 -m pip install --requirement requirements.txt
+RUN --mount=target=/root/.cache/pip,type=cache,id=pip-${TARGETPLATFORM},sharing=locked \
+ python3 -m pip \
+ --disable-pip-version-check \
+ install \
+ --requirement requirements.txt
# Output container
FROM base
@@ -30,8 +34,8 @@ ARG VERSION
ENV VERSION=${VERSION}
RUN useradd -m appuser \
- && mkdir /app \
- && chown -R appuser:appuser /app
+ && mkdir /app \
+ && chown -R appuser:appuser /app
USER appuser