Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jaspr_tailwind:compiler on web/styles.tw.css taking forever #332

Open
rezmeplxrf opened this issue Nov 5, 2024 · 1 comment
Open

jaspr_tailwind:compiler on web/styles.tw.css taking forever #332

rezmeplxrf opened this issue Nov 5, 2024 · 1 comment

Comments

@rezmeplxrf
Copy link

rezmeplxrf commented Nov 5, 2024

Description
I am using custom server: shelf, tailwindcss + daisyUI.
I can build the project by running 'jaspr build' locally.
But I am trying to get it run within a docker and when building the image it never ends.
I am not very good with docker but it see

Here's the docker log when building the image:

 => => # [BUILDER] [WARNing] No actions completed for 15.1s, waiting on:                                                                      
 => => # [BUILDER] [WARNing] - jaspr_tailwind:compiler on web/styles.tw.css                                                                   
 => => # [BUILDER] 7m 52s elapsed, 207/208 actions completed.     

Additional Context

Dockerfile

FROM dart:latest AS build

### Install Node.js and other dependencies
RUN apt-get update && apt-get install -y apt-transport-https wget gnupg curl && \
    curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg && \
    echo "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x $(. /etc/os-release && echo "$VERSION_CODENAME") main" > /etc/apt/sources.list.d/nodesource.list && \
    apt-get update && \
    apt-get install -y nodejs npm && \
    npm install -g npm@latest

### Activate the jaspr cli.
RUN dart pub global activate jaspr_cli


WORKDIR /app
COPY . .

### Install TailwindCSS
RUN curl -fsSL https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-x64 -o tailwindcss && \
    chmod +x tailwindcss && \
    mv tailwindcss /usr/local/bin/tailwindcss && \
    tailwindcss --help > /dev/null

### Install DaisyUI
RUN npm init -y && \
    npm install daisyui@latest

RUN rm -f pubspec_overrides.yaml
RUN dart pub get
RUN dart pub global run jaspr_cli:jaspr build --verbose

FROM scratch

COPY --from=build /runtime/ /
COPY --from=build /app/build/jaspr/ /app/

WORKDIR /app

EXPOSE 8080
CMD ["./app"]

tailwind.config.js

/** @type {import('tailwindcss').Config} */
module.exports = {
    content: ['./{lib,web}/**/*.dart'],
    theme: {
      extend: {},
    },
    daisyui: {
        themes: ["cupcake"],
      },
    plugins: [require("daisyui")],
  }

pubspec.yaml

name: media_server
description: A new jaspr project.
version: 0.0.1
publish_to: "none" 

environment:
  sdk: ">=3.0.0 <4.0.0"

dependencies:
  jaspr: ^0.16.1
  jaspr_router: ^0.6.0
  shelf: ^1.4.0
  shelf_router: ^1.1.0
  freezed_annotation: ^2.4.4
  json_annotation: ^4.9.0
  mime: ^1.0.6
  schedulers:
  intl: ^0.19.0
  shelf_multipart: ^2.0.0
  sembast: ^3.7.5

dev_dependencies:
  build_runner: ^2.4.0
  build_web_compilers: ^4.0.11
  jaspr_builder: ^0.16.1
  jaspr_lints: ^0.1.2
  lints: ^3.0.0
  freezed: ^2.5.7
  json_serializable:
  dio:
  jaspr_tailwind: ^0.3.0

jaspr:
  mode: server

/web/styles.tw.css

@tailwind base;
@tailwind components;
@tailwind utilities;
@rezmeplxrf
Copy link
Author

rezmeplxrf commented Nov 5, 2024

as a workaround, I can just build the style.css locally and then copy it to docker by running "tailwindcss --input web/styles.tw.css --output web/styles.css --config tailwind.config.js". but I feel there should be some documentation or fix for those who want to ship their app in a docker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant