-
Notifications
You must be signed in to change notification settings - Fork 25
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
Bugfix : CSS assets are not available in the docker image #1110
Bugfix : CSS assets are not available in the docker image #1110
Conversation
Seems the archethic-node/scripts/release.sh Lines 91 to 92 in f11e049
|
I added it, but could not manage to fix the error I get:
|
AFAIK sass is not working on this alpine. I might require help to debug further. tried gcompat but I get the same error with code 139. |
I think I know why it works for me : I compiled everything "locally" before building the docker image, so the assets are already compiled and if they are not ignored by the |
yes exactly. I never saw the issue for the same reason. To reproduce it, I clone the repository and run the |
Have you seen this Elixir mix ? There is a FAQ regarding dart-sass and Alpine linux at the end of the README. |
wow great find, much better than the solution I hacked: FROM elixir:1.14.1-alpine AS archethic-ci
ARG with_tests=1
ARG MIX_ENV=prod
ARG USER_ID
ARG GROUP_ID
# CI
# - compile
# - release
# - gen PLT
# running CI with proposal should generate release upgrade
# - commit proposal
# - compile
# - run ci
# - generate release upgrade
######### TODO
# TESTNET
# - code
# - release
ENV ARCHETHIC_NETWORK_TYPE=testnet
RUN apk add --no-cache --update \
build-base \
grep \
bash \
gcc \
make \
g++ \
git \
npm \
wget \
openssl \
libsodium-dev \
libexecinfo-dev \
gmp-dev \
sassc
# Install hex and rebar
RUN mix local.rebar --force \
&& mix local.hex --if-missing --force
WORKDIR /opt/code
# install mix dependencies
COPY Makefile Makefile
COPY mix.exs mix.lock ./
COPY config ./config
RUN mix do deps.get, deps.compile
# build assets
COPY priv ./priv
COPY assets ./assets
RUN npm --prefix ./assets ci --progress=false --no-audit --loglevel=error
# sass
WORKDIR /opt/code/assets/css
RUN sassc app.scss > app.css
WORKDIR /opt/code
# copy the rest of the folder
COPY . .
RUN git config user.name aebot \
&& git config user.email [email protected] \
&& git remote add origin https://github.com/archethic-foundation/archethic-node
# build release
RUN mix compile
RUN mix assets.deploy
RUN mkdir -p priv/static/css
RUN cp assets/css/app.css priv/static/css
RUN mix distillery.release
# Install
RUN mkdir -p /opt/app \
&& tar zxf /opt/code/_build/${MIX_ENV}/rel/archethic_node/releases/*/archethic_node.tar.gz -C /opt/app
CMD /opt/app/bin/archethic_node foreground
################################################################################
FROM archethic-ci as build
FROM elixir:1.14.1-alpine
ARG USER_ID
ARG GROUP_ID
RUN apk add --no-cache --update bash git openssl libsodium libexecinfo miniupnpc
COPY --from=build /opt/app /opt/app
COPY --from=build /opt/code/.git /opt/code/.git
WORKDIR /opt/code
RUN git reset --hard
RUN rm -rf /opt/code/.git
RUN rm -rf /opt/code/priv
WORKDIR /opt/app
CMD /opt/app/bin/archethic_node foreground I'll try it right now |
Unfortunately I couldn't make it work. I'll try to get some help this week |
Took me a while but I think I got it, I used the |
My ...
# https://github.com/cargosense/dart_sass#compatibility-with-alpine-linux-mix-sass-default-exited-with-2
ENV GLIBC_VERSION=2.34-r0
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub &&\
wget -q -O /tmp/glibc.apk https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk &&\
apk add --force-overwrite /tmp/glibc.apk &&\
rm -rf /tmp/glibc.apk
# Install hex and rebar
RUN mix local.rebar --force &&\
mix local.hex --if-missing --force
... |
Just tested the "fixed" version (with backslashes) and it works, the CSS assets look good now. |
Seems because app folder is copied over the built assets. Looks like COPYing the app folder once is sufficient to be able to build everything after
Should this branch be rebased over |
60cbfd9
to
f272826
Compare
Develop is the good one |
Seems because app folder is copied over the built assets.
Looks like COPYing the app folder once is sufficient to be able to build everything after
(Rebased over today's develop branch)