Skip to content

Commit 908f8e7

Browse files
committed
More cleanup and making sure node files are copied over to the static folder
1 parent ab4efc7 commit 908f8e7

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

extras/docker/development/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ FROM wger/server:latest
99
USER root
1010

1111
WORKDIR /home/wger/src
12-
RUN apt-get update && \
13-
apt-get install --no-install-recommends -y \
12+
RUN wget -O- https://deb.nodesource.com/setup_22.x | bash - \
13+
apt update && \
14+
apt install --no-install-recommends -y \
1415
git \
1516
vim \
16-
yarnpkg \
17+
nodejs \
1718
sassc \
1819
&& apt-get clean \
1920
&& rm -rf /var/lib/apt/lists/* \
@@ -22,6 +23,6 @@ RUN apt-get update && \
2223

2324
USER wger
2425
COPY --chown=wger:wger . /home/wger/src
25-
RUN yarn install \
26+
RUN yarn install:force \
2627
&& yarn build:css:sass \
2728
&& pip3 install --break-system-packages --user --group dev --editable .

extras/docker/production/Dockerfile

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,11 @@ RUN wget -O- https://deb.nodesource.com/setup_22.x | bash - \
4141
#
4242
WORKDIR /root/src
4343

44-
# Copy necessary files to build the application
44+
# Build the application
4545
COPY pyproject.toml /root/src
4646
COPY wger/version.py /root/src/wger/
4747
COPY wger/__init__.py /root/src/wger/
4848
COPY README.md /root/src
49-
COPY package.json /root/src
50-
COPY yarn.lock /root/src
51-
COPY wger/core/static /root/src/wger/core/static
5249

5350
# NB: the --mount tmpfs is a workaround for https://github.com/rust-lang/cargo/issues/8719
5451
RUN --mount=type=tmpfs,target=/root/.cargo \
@@ -58,11 +55,10 @@ RUN --mount=type=tmpfs,target=/root/.cargo \
5855
--group docker . \
5956
&& ln -s /usr/bin/sassc /usr/bin/sass
6057

61-
#
6258
# Build the JS and CSS files
63-
#
64-
RUN yarn config set nodeLinker node-modules \
65-
&& yarn install \
59+
COPY package.json yarn.lock .yarnrc.yml ./
60+
COPY wger/core/static /root/src/wger/core/static
61+
RUN yarn install \
6662
&& yarn build:css:sass \
6763
&& cd .. \
6864
&& wget https://github.com/wger-project/react/archive/refs/heads/master.zip \

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "2.4.alpha1",
44
"description": "Self hosted FLOSS fitness/workout and weight tracker",
55
"repository": "github:wger-project/wger",
6-
"author": "",
6+
"author": "wger team <[email protected]>",
77
"license": "AGPL-3.0",
88
"bugs": {
99
"url": "https://github.com/wger-project/wger/issues"
@@ -22,7 +22,7 @@
2222
},
2323
"scripts": {
2424
"build:css:sass": "sass wger/core/static/scss/main.scss wger/core/static/yarn/bootstrap-compiled.css",
25-
"install": "yarn install && yarn run postinstall",
25+
"install:force": "yarn install && yarn run postinstall",
2626
"postinstall": "rm -rf wger/core/static/yarn/ && mkdir -p wger/core/static/yarn/ && cp -r node_modules/* wger/core/static/yarn/"
2727
},
2828
"engines": {

0 commit comments

Comments
 (0)