@@ -32,24 +32,31 @@ RUN apt update \
32
32
libpq-dev \
33
33
rustc \
34
34
cargo \
35
- yarnpkg \
36
35
sassc \
37
- && ln -s /usr/bin/yarnpkg /usr/bin/yarn \
38
36
&& ln -s /usr/bin/sassc /usr/bin/sass
39
37
38
+ # Need a newer node than what's in ubuntu
39
+ RUN wget -O- https://deb.nodesource.com/setup_22.x | bash - \
40
+ && apt-get update \
41
+ && apt-get install -y nodejs \
42
+ && rm -rf /var/lib/apt/lists/* \
43
+ && corepack enable
44
+
40
45
# Build the necessary python wheels
41
46
# Note that the --mount is a workaround for https://github.com/rust-lang/cargo/issues/8719
42
- COPY pyproject.toml .
43
- COPY wger/version.py ./wger/version.py
44
- COPY wger/__init__.py ./wger/__init__.py
45
- COPY README.md ./README.md
46
- RUN --mount=type=tmpfs,target=/root/.cargo pip3 wheel --no-cache-dir --wheel-dir /wheels --group docker . \
47
- && pip3 install --break-system-packages --user --no-cache-dir /wheels/*
48
-
49
- COPY . /home/wger/src
47
+ # COPY . /home/wger/src
50
48
WORKDIR /home/wger/src
51
- RUN yarn install \
52
- && yarn build:css:sass
49
+
50
+ COPY pyproject.toml /home/wger/src
51
+ COPY wger/version.py /home/wger/src/wger/
52
+ COPY wger/__init__.py /home/wger/src/wger/
53
+ COPY README.md /home/wger/src
54
+ COPY package.json /home/wger/src
55
+ COPY yarn.lock /home/wger/src
56
+ COPY wger/core/static /home/wger/src/wger/core/static
57
+ RUN --mount=type=tmpfs,target=/root/.cargo pip3 wheel --no-cache-dir --wheel-dir /wheels --group docker . \
58
+ && yarn install \
59
+ && yarn build:css:sass
53
60
54
61
55
62
# #######
@@ -90,7 +97,6 @@ RUN chmod 0644 /etc/cron.d/wger \
90
97
&& chmod +x /home/wger/venvwrapper \
91
98
&& touch /var/log/cron.log
92
99
93
- COPY --from=builder /wheels /wheels
94
100
COPY --chown=wger:www-data . /home/wger/src
95
101
COPY --from=builder --chown=wger:wger /home/wger/src/wger/core/static/yarn /home/wger/src/wger/core/static/yarn
96
102
@@ -107,7 +113,7 @@ RUN mkdir -p ~/static/CACHE ~/media \
107
113
&& ln -s /home/wger/static/CACHE /home/wger/src/CACHE \
108
114
&& chmod g+w /home/wger/static/CACHE
109
115
110
- RUN . /home/wger/venv/bin/activate \
116
+ RUN --mount=type=bind,from=builder,source=/wheels,target=/wheels . /home/wger/venv/bin/activate \
111
117
&& pip install --upgrade pip \
112
118
&& pip install --no-cache /wheels/* \
113
119
&& pip install -e . \
0 commit comments