From 7c98c35c0c47df065129b582872c13466094e376 Mon Sep 17 00:00:00 2001 From: daveads Date: Mon, 28 Oct 2024 11:12:08 +0100 Subject: [PATCH] docker test --- docker/Dockerfile | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index da5c7383c..58638ba85 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -140,6 +140,45 @@ ENV OPAL_POLICY_STORE_URL=http://localhost:8180 EXPOSE 8180 USER opal + +# OPENFGA CLIENT IMAGE -------------------------------- +# Using standalone image as base -------------------- +# --------------------------------------------------- +FROM client-standalone AS client-openfga + +# Temporarily move back to root for additional setup +USER root + +# Install wget and tar, download OpenFGA, then cleanup +RUN apt-get update && \ + apt-get install -y wget && \ + wget https://github.com/openfga/openfga/releases/download/v1.6.2/openfga_1.6.2_linux_amd64.tar.gz && \ + tar xzf openfga_1.6.2_linux_amd64.tar.gz && \ + mv openfga /usr/local/bin/ && \ + chmod +x /usr/local/bin/openfga && \ + rm openfga_1.6.2_linux_amd64.tar.gz && \ + apt-get remove -y wget && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Copy and set up startup script +COPY ./scripts/start-openfga.sh . +RUN chmod +x start-openfga.sh + +# Enable inline OpenFGA +ENV OPAL_POLICY_STORE_TYPE=OPENFGA +ENV OPAL_INLINE_OPENFGA_ENABLED=true +ENV OPAL_INLINE_OPENFGA_CONFIG='{"addr": "0.0.0.0:8080"}' +ENV OPAL_POLICY_STORE_URL=http://localhost:8080 + +# Expose OpenFGA ports +EXPOSE 8080 3000 + +USER opal + +# Override the default command to use our custom script +CMD ["./start-openfga.sh"] + # SERVER IMAGE -------------------------------------- # --------------------------------------------------- FROM common AS server