1
1
ARG RELEASE="0.0.0-unknown"
2
2
3
3
4
- FROM node:lts-alpine AS tailwind
5
-
6
- # Compile Tailwind CSS
7
- RUN mkdir -p /opt/build
8
- COPY tailwind.config.js /opt/build/
9
- COPY dashboard/ /opt/build/dashboard
10
- WORKDIR /opt/build
11
- RUN npm install -D tailwindcss && \
12
- npx tailwindcss -i ./dashboard/static/css/base.css \
13
- -o ./dashboard/static/css/main.css --minify
14
-
15
-
16
- FROM python:3.12 AS dependencies
4
+ FROM --platform=$BUILDPLATFORM python:3.11 AS dependencies
5
+ ARG TARGETARCH
17
6
18
7
# Install build-essential for building Python packages
19
- RUN apt-get update && apt-get install -y build-essential
8
+ RUN apt-get update && apt-get install -y build-essential curl
20
9
21
10
# Install Poetry
22
11
RUN pip install poetry==1.8.2
@@ -25,21 +14,33 @@ ENV POETRY_NO_INTERACTION=1 \
25
14
POETRY_VIRTUALENVS_CREATE=1 \
26
15
POETRY_CACHE_DIR=/tmp/poetry_cache
27
16
28
- # Install dependencies
17
+ # Copy files
29
18
WORKDIR /app
30
- COPY pyproject.toml poetry.lock ./
31
- RUN --mount=type=cache,target=$POETRY_CACHE_DIR poetry install --without dev
32
- RUN --mount=type=cache,target=$POETRY_CACHE_DIR poetry add setuptools
19
+ COPY pyproject.toml poetry.lock tailwind.config.js dashboard/static/css/base.css ./
33
20
21
+ # Install dependencies
22
+ RUN --mount=type=cache,target=$POETRY_CACHE_DIR poetry install --without dev
34
23
35
- FROM python:3.12-slim AS main
24
+ # Compile Tailwind CSS
25
+ RUN echo "Downloading Tailwind CLI for ${TARGETARCH}" && \
26
+ if [ "${TARGETARCH}" = "arm64" ]; then \
27
+ curl -sL https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-arm64 -o ./tailwindcss; \
28
+ else \
29
+ echo "Downloading amd64 version of Tailwind CSS" ; \
30
+ curl -sL https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-amd64 -o ./tailwindcss; \
31
+ fi && \
32
+ chmod +x ./tailwindcss && \
33
+ ./tailwindcss -i ./base.css -o ./main.css --minify
34
+
35
+
36
+ FROM python:3.11-slim AS main
36
37
ARG RELEASE
37
38
LABEL maintainer=
"Jared Dantis <[email protected] >"
38
39
39
40
# Copy bot files
40
41
COPY . /opt/app
41
42
COPY --from=dependencies /app/.venv /opt/venv
42
- COPY --from=tailwind /opt/build/dashboard/static/css /main.css /opt/app/dashboard/static/css/main.css
43
+ COPY --from=dependencies /app /main.css /opt/app/dashboard/static/css/main.css
43
44
WORKDIR /opt/app
44
45
45
46
# Set release
0 commit comments