Skip to content

Commit 9e878dc

Browse files
committed
Some cleanup of the demo Dockerfile
1 parent c509e04 commit 9e878dc

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

extras/docker/demo/Dockerfile

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,31 @@ RUN apt update \
3232
libpq-dev \
3333
rustc \
3434
cargo \
35-
yarnpkg \
3635
sassc \
37-
&& ln -s /usr/bin/yarnpkg /usr/bin/yarn \
3836
&& ln -s /usr/bin/sassc /usr/bin/sass
3937

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+
4045
# Build the necessary python wheels
4146
# 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
5048
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
5360

5461

5562
########
@@ -90,7 +97,6 @@ RUN chmod 0644 /etc/cron.d/wger \
9097
&& chmod +x /home/wger/venvwrapper \
9198
&& touch /var/log/cron.log
9299

93-
COPY --from=builder /wheels /wheels
94100
COPY --chown=wger:www-data . /home/wger/src
95101
COPY --from=builder --chown=wger:wger /home/wger/src/wger/core/static/yarn /home/wger/src/wger/core/static/yarn
96102

@@ -107,7 +113,7 @@ RUN mkdir -p ~/static/CACHE ~/media \
107113
&& ln -s /home/wger/static/CACHE /home/wger/src/CACHE \
108114
&& chmod g+w /home/wger/static/CACHE
109115

110-
RUN . /home/wger/venv/bin/activate \
116+
RUN --mount=type=bind,from=builder,source=/wheels,target=/wheels . /home/wger/venv/bin/activate \
111117
&& pip install --upgrade pip \
112118
&& pip install --no-cache /wheels/* \
113119
&& pip install -e . \

extras/docker/production/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ RUN wget -O- https://deb.nodesource.com/setup_22.x | bash - \
3535
&& apt-get update \
3636
&& apt-get install -y nodejs \
3737
&& rm -rf /var/lib/apt/lists/* \
38-
&& mkdir -p /etc/apt/keyrings \
3938
&& corepack enable \
4039
&& mkdir -p /root/src/wger/core/static
4140

0 commit comments

Comments
 (0)