From 0da4cc6fbeb38def05a111d89f88403598fa5b11 Mon Sep 17 00:00:00 2001 From: Guillaume Tucker Date: Mon, 28 Aug 2023 10:42:24 +0200 Subject: [PATCH] docker/api: add Dockerfile.production Add Dockerfile.production to build the kernelci/api Docker image for production deployment. It installs the "api" package using pip directly in the image so it's self-contained. This relies on pyproject.toml to be set up correctly. This is an alternative to the standard Dockerfile used by docker-compose for a local deployment based directly on the source tree. Signed-off-by: Guillaume Tucker --- docker/api/Dockerfile.production | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 docker/api/Dockerfile.production diff --git a/docker/api/Dockerfile.production b/docker/api/Dockerfile.production new file mode 100644 index 00000000..8a53d3a8 --- /dev/null +++ b/docker/api/Dockerfile.production @@ -0,0 +1,25 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# +# Copyright (C) 2023 Collabora Limited +# Author: Guillaume Tucker + +FROM python:3.10 +MAINTAINER "KernelCI TSC" + +# Upgrade pip3 - never mind the warning about running this as root +RUN pip3 install --upgrade "pip==23.2.1" + +# Upgrade setuptools for full pyproject.toml support +RUN pip3 install "setuptools==68.1.2" + +# Create kernelci user +RUN useradd kernelci -u 1000 -d /home/kernelci -s /bin/bash +RUN mkdir -p /home/kernelci +RUN chown kernelci: /home/kernelci +USER kernelci +ENV PATH=$PATH:/home/kernelci/.local/bin +WORKDIR /home/kernelci + +ARG api_url=https://github.com/kernelci/kernelci-api.git +ARG api_rev=main +RUN pip install git+$api_url@$api_rev