Skip to content

Commit

Permalink
ci: Make Docker build work in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jamilraichouni committed Jan 30, 2025
1 parent 9595732 commit 6e313b4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/build-test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,3 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- TAILWIND_CSS_CLI_VERSION=python -c 'from capella_model_explorer.__main__ import DEFAULTS as d; print(d["TAILWIND_CSS_CLI_VERSION"])'
- TAILWIND_CSS_TYPOGRAPHY_VERSION=python -c 'from capella_model_explorer.__main__ import DEFAULTS as d; print(d["TAILWIND_CSS_TYPOGRAPHY_VERSION"])'
- TAILWIND_CSS_VERSION=python -c 'from capella_model_explorer.__main__ import DEFAULTS as d; print(d["TAILWIND_CSS_VERSION"])'
24 changes: 12 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
# SPDX-License-Identifier: Apache-2.0

FROM python:3.12-slim-bookworm
ARG TAILWIND_CSS_VERSION
ARG TAILWIND_CSS_CLI_VERSION
ARG TAILWIND_CSS_TYPOGRAPHY_VERSION
USER root
WORKDIR /app
ENV HOME=/home
Expand Down Expand Up @@ -49,27 +46,30 @@ RUN git config --global --add safe.directory /model && \
# Run as non-root user per default
USER 1000

# install tailwindcss stuff {{{
RUN npm install -D \
tailwindcss@${TAILWIND_CSS_VERSION} \
@tailwindcss/cli@${TAILWIND_CSS_CLI_VERSION} \
@tailwindcss/typography@${TAILWIND_CSS_TYPOGRAPHY_VERSION}
# }}}

# install uv {{{
RUN curl -Lo /tmp/install.sh https://astral.sh/uv/install.sh && \
chmod +x /tmp/install.sh && \
UV_NO_MODIFY_PATH=1 sh /tmp/install.sh && \
rm /tmp/install.sh
# }}}

# install app incl. its cli, elk.js, and build stylesheet {{{
# install app incl. its cli and install elk.js {{{
RUN uv venv && \
# install app
uv pip install --no-cache-dir . && \
# Install elk.js automatically into a persistent local cache directory
# in order to prepare the elk.js execution environment ahead of time.
uv run python3 -c "from capellambse_context_diagrams import install_elk; install_elk()" && \
uv run python3 -c "from capellambse_context_diagrams import install_elk; install_elk()"
# }}}

# install tailwindcss stuff {{{
RUN export TAILWIND_CSS_VERSION="$(python -c 'from capella_model_explorer.__main__ import DEFAULTS as d; print(d["TAILWIND_CSS_VERSION"])')" && \
export TAILWIND_CSS_CLI_VERSION="$(python -c 'from capella_model_explorer.__main__ import DEFAULTS as d; print(d["TAILWIND_CSS_CLI_VERSION"])')" && \
export TAILWIND_CSS_TYPOGRAPHY_VERSION="$(python -c 'from capella_model_explorer.__main__ import DEFAULTS as d; print(d["TAILWIND_CSS_TYPOGRAPHY_VERSION"])')" && \
npm install -D \
tailwindcss@${TAILWIND_CSS_VERSION} \
@tailwindcss/cli@${TAILWIND_CSS_CLI_VERSION} \
@tailwindcss/typography@${TAILWIND_CSS_TYPOGRAPHY_VERSION} && \
# build stylesheet
uv run python3 -m capella_model_explorer build css
# }}}
Expand Down

0 comments on commit 6e313b4

Please sign in to comment.