diff --git a/build-docker.sh b/build-docker.sh new file mode 100755 index 000000000..82ad805ae --- /dev/null +++ b/build-docker.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +sudo docker build -t openstack-mistral:latest -f tools/docker/Dockerfile . diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile new file mode 100644 index 000000000..4a4301585 --- /dev/null +++ b/tools/docker/Dockerfile @@ -0,0 +1,39 @@ +# +# Builder +# + +FROM debian:bookworm-slim AS builder +LABEL maintainer="Arnaud Morin " + +RUN apt-get update && apt-get install -y \ + python3 python3-venv python3-pip git \ + && rm -rf /var/lib/apt/lists/* + +# Create venv +WORKDIR /opt/openstack/ +RUN python3 -m venv mistral && \ + /opt/openstack/mistral/bin/pip install --upgrade pip setuptools + +# Copy source code +WORKDIR /src/mistral +COPY . . + +# Install mistral +RUN /opt/openstack/mistral/bin/pip install -r requirements.txt && \ + /opt/openstack/mistral/bin/pip install . + +# +# Runner +# +FROM debian:bookworm-slim +LABEL maintainer="Arnaud Morin " + +RUN apt-get update && apt-get install -y \ + python3 \ + && rm -rf /var/lib/apt/lists/* + +COPY --from=builder /opt/openstack/mistral /opt/openstack/mistral + +RUN ln -s /opt/openstack/mistral/bin/mistral-server /usr/local/bin/ + +USER root