Skip to content

Commit

Permalink
docker test
Browse files Browse the repository at this point in the history
  • Loading branch information
daveads committed Oct 28, 2024
1 parent 2a89c34 commit 7c98c35
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7c98c35

Please sign in to comment.