Skip to content

Commit

Permalink
docker/api: add Dockerfile.production
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
gctucker committed Aug 31, 2023
1 parent bb6e6f2 commit 0da4cc6
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docker/api/Dockerfile.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# Copyright (C) 2023 Collabora Limited
# Author: Guillaume Tucker <[email protected]>

FROM python:3.10
MAINTAINER "KernelCI TSC" <[email protected]>

# 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

0 comments on commit 0da4cc6

Please sign in to comment.