Skip to content

Commit e0cd965

Browse files
authored
Merge branch 'master' into dependabot/pip/django-debug-toolbar-4.4.6
2 parents 1793ff2 + c512614 commit e0cd965

File tree

151 files changed

+14106
-17501
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+14106
-17501
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ updates:
2121
interval: "daily"
2222

2323
- package-ecosystem: "docker"
24-
directory: "/extras/docker/development/"
24+
directory: "/extras/docker/production/"
2525
schedule:
2626
interval: "daily"

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
strategy:
2020
matrix:
2121
#TODO: pypy3 has problems compiling lxml
22-
python-version: [ '3.10', '3.11', '3.12' ]
22+
python-version: [ '3.10', '3.11', '3.12', '3.13' ]
2323
name: CI job (python ${{ matrix.python-version }})
2424

2525
steps:

.github/workflows/docker-base.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
uses: actions/checkout@v4
2222

2323
- name: Set up QEMU
24-
uses: docker/setup-qemu-action@v3.1.0
24+
uses: docker/setup-qemu-action@v3.2.0
2525

2626
- name: Set up Docker Buildx
2727
uses: docker/setup-buildx-action@v3

.github/workflows/docker-demo.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
uses: actions/checkout@v4
2424

2525
- name: Set up QEMU
26-
uses: docker/setup-qemu-action@v3.1.0
26+
uses: docker/setup-qemu-action@v3.2.0
2727

2828
- name: Set up Docker Buildx
2929
uses: docker/setup-buildx-action@v3
@@ -41,4 +41,4 @@ jobs:
4141
push: true
4242
file: extras/docker/demo/Dockerfile
4343
platforms: linux/amd64,linux/arm64
44-
tags: ${{ vars.REGISTRY_REPO }}/demo:latest,${{ vars.REGISTRY_REPO }}/demo:2.3-dev,${{ vars.REGISTRY_REPO }}/apache:latest,${{ vars.REGISTRY_REPO }}/apache:2.3-dev
44+
tags: ${{ vars.REGISTRY_REPO }}/demo:latest,${{ vars.REGISTRY_REPO }}/demo:2.3-dev

.github/workflows/docker.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99

1010
env:
1111
REGISTRY_IMAGE: ${{ vars.REGISTRY_REPO }}/server
12-
REGISTRY_IMAGE_ALT: ${{ vars.REGISTRY_REPO }}/devel
1312

1413
jobs:
1514
build-prod:
@@ -23,6 +22,11 @@ jobs:
2322
- linux/arm/v7
2423
- linux/arm64
2524
steps:
25+
- name: Prepare
26+
run: |
27+
platform=${{ matrix.platform }}
28+
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
29+
2630
- name: Checkout
2731
uses: actions/checkout@v4
2832

@@ -37,10 +41,9 @@ jobs:
3741
type=raw,value=2.3-dev
3842
images: |
3943
${{ env.REGISTRY_IMAGE }}
40-
${{ env.REGISTRY_IMAGE_ALT }}
4144
4245
- name: Set up QEMU
43-
uses: docker/setup-qemu-action@v3.1.0
46+
uses: docker/setup-qemu-action@v3.2.0
4447

4548
- name: Set up Docker Buildx
4649
id: buildx
@@ -67,7 +70,7 @@ jobs:
6770
uses: docker/build-push-action@v6
6871
with:
6972
context: .
70-
file: extras/docker/development/Dockerfile
73+
file: extras/docker/production/Dockerfile
7174
builder: ${{ steps.buildx.outputs.name }}
7275
platforms: ${{ matrix.platform }}
7376
labels: ${{ steps.meta.outputs.labels }}
@@ -85,9 +88,9 @@ jobs:
8588
touch "/tmp/digests/${digest#sha256:}"
8689
8790
- name: Upload digest
88-
uses: actions/upload-artifact@v3
91+
uses: actions/upload-artifact@v4
8992
with:
90-
name: digests
93+
name: digests-${{ env.PLATFORM_PAIR }}
9194
path: /tmp/digests/*
9295
if-no-files-found: error
9396
retention-days: 1
@@ -103,10 +106,11 @@ jobs:
103106
- build-prod
104107
steps:
105108
- name: Download digests
106-
uses: actions/download-artifact@v3
109+
uses: actions/download-artifact@v4
107110
with:
108-
name: digests
109111
path: /tmp/digests
112+
pattern: digests-*
113+
merge-multiple: true
110114

111115
- name: Set up Docker Buildx
112116
uses: docker/setup-buildx-action@v3
@@ -120,7 +124,6 @@ jobs:
120124
type=raw,value=2.3-dev
121125
images: |
122126
${{ env.REGISTRY_IMAGE }}
123-
${{ env.REGISTRY_IMAGE_ALT }}
124127
125128
- name: Login to Docker Hub
126129
uses: docker/login-action@v3

AUTHORS.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ Developers
7979
* Ethan Winters - https://github.com/ebwinters
8080
* Dieter Plaetinck - https://github.com/Dieterbe
8181
* Jonathan La Field - https://github.com/JLaField
82+
* Kevin Moy - https://github.com/kmoy1
83+
* Taylor Fuller - https://github.com/taylor-fuller
84+
* eyJhb - https://github.com/eyJhb
85+
* Joshua Shelley - https://github.com/navyjosh
86+
* Matt Harrison - https://github.com/Maralai
8287

8388

8489
Translators

extras/docker/base/Dockerfile

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,32 @@
88
# docker build --tag wger/base .
99
#
1010

11-
FROM ubuntu:22.04
11+
FROM ubuntu:24.04
1212

1313
LABEL maintainer="Roland Geider <roland@geider.net>"
1414

1515
# Install dependencies
1616
ENV DEBIAN_FRONTEND=noninteractive
1717
RUN apt update \
1818
&& apt install --no-install-recommends -y \
19+
adduser \
1920
locales \
20-
nodejs \
21-
npm \
2221
python3-pip \
2322
sqlite3 \
2423
wget \
2524
tzdata \
2625
libpq5 \
27-
&& npm install -g yarn sass\
2826
&& locale-gen en_US.UTF-8
2927

3028
# Environmental variables
31-
ENV LANG en_US.UTF-8
32-
ENV LANGUAGE en_US:en
33-
ENV LC_ALL en_US.UTF-8
29+
ENV LANG=en_US.UTF-8
30+
ENV LANGUAGE=en_US:en
31+
ENV LC_ALL=en_US.UTF-8
3432

35-
ENV PYTHONDONTWRITEBYTECODE 1
36-
ENV PYTHONUNBUFFERED 1
33+
ENV PYTHONDONTWRITEBYTECODE=1
34+
ENV PYTHONUNBUFFERED=1
3735

3836

3937
# Add wger user
40-
RUN adduser wger --disabled-password --gecos ""
38+
RUN deluser ubuntu
39+
RUN adduser wger --uid 1000 --disabled-password --gecos ""

extras/docker/demo/Dockerfile

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
##########
1818
# Builder
1919
##########
20-
FROM wger/base:latest as builder
20+
FROM wger/base:latest AS builder
2121
ARG DEBIAN_FRONTEND=noninteractive
2222

2323
RUN apt update \
@@ -32,20 +32,29 @@ RUN apt update \
3232
libpq-dev \
3333
rustc \
3434
cargo \
35-
&& pip install --upgrade pip
35+
yarnpkg \
36+
sassc
3637

3738
# Build the necessary python wheels
3839
# Note that the --mount is a workaround for https://github.com/rust-lang/cargo/issues/8719
3940
COPY requirements* ./
40-
RUN --mount=type=tmpfs,target=/root/.cargo pip3 wheel --no-cache-dir --wheel-dir /wheels -r requirements_docker.txt
41+
RUN --mount=type=tmpfs,target=/root/.cargo pip3 wheel --no-cache-dir --wheel-dir /wheels -r requirements_docker.txt \
42+
&& pip3 install --break-system-packages --user --no-cache-dir /wheels/*
43+
44+
COPY . /home/wger/src
45+
WORKDIR /home/wger/src
46+
RUN ln -s /usr/bin/yarnpkg /usr/bin/yarn \
47+
&& ln -s /usr/bin/sassc /usr/bin/sass \
48+
&& yarn install \
49+
&& yarn build:css:sass
4150

4251

4352
########
4453
# Final
4554
########
4655
FROM wger/base:latest
4756
LABEL maintainer="Roland Geider <roland@geider.net>"
48-
57+
ENV TERM=xterm
4958
ARG DOCKER_DIR=./extras/docker/demo
5059
EXPOSE 80
5160

@@ -70,45 +79,46 @@ RUN a2dissite 000-default.conf \
7079
# Configure cron
7180
COPY ${DOCKER_DIR}/crontab /etc/cron.d/wger
7281
COPY ${DOCKER_DIR}/venvwrapper /home/wger/venvwrapper
73-
COPY ${DOCKER_DIR}/entrypoint.sh /home/wger/entrypoint.sh
7482

7583
RUN chmod 0644 /etc/cron.d/wger \
76-
&& chmod +x /home/wger/venvwrapper /home/wger/entrypoint.sh \
84+
&& chmod +x /home/wger/venvwrapper \
7785
&& touch /var/log/cron.log
7886

7987
COPY --from=builder /wheels /wheels
8088
COPY --chown=wger:www-data . /home/wger/src
89+
COPY --from=builder --chown=wger:wger /home/wger/src/wger/core/static/yarn /home/wger/src/wger/core/static/yarn
8190

8291
# Set up the application
8392
RUN ln -s /home/wger/static/CACHE /var/www
8493
USER wger
8594

8695
WORKDIR /home/wger/src
87-
#RUN git clone https://github.com/wger-project/wger.git
8896
RUN python3 -m venv /home/wger/venv
97+
98+
# Change permissions of some files and folders so the apache process
99+
# can access them.
100+
RUN mkdir -p ~/static/CACHE ~/media \
101+
&& ln -s /home/wger/static/CACHE /home/wger/src/CACHE \
102+
&& chmod g+w /home/wger/static/CACHE
103+
89104
RUN . /home/wger/venv/bin/activate \
90105
&& pip install --upgrade pip \
91106
&& pip install --no-cache /wheels/* \
92107
&& pip install -e . \
93108
&& wger create-settings --database-path /home/wger/db/database.sqlite \
94-
&& wger bootstrap \
95-
&& wger load-online-fixtures \
109+
&& sed -i "/^MEDIA_ROOT/c\MEDIA_ROOT='\/home\/wger\/media'" settings.py \
110+
&& echo STATIC_ROOT=\'/home/wger/static\' >> settings.py \
111+
&& wger bootstrap --no-process-static \
96112
&& python3 manage.py sync-exercises \
97-
&& python3 manage.py download-exercise-images
113+
&& wger load-online-fixtures \
114+
&& python3 manage.py download-exercise-images \
115+
&& python3 manage.py collectstatic --no-input
98116

99117

100-
# Change permissions of some files and folders so the apache process
101-
# can access them.
102-
RUN mkdir -p ~/static/CACHE ~/media \
103-
&& ln -s /home/wger/static/CACHE /home/wger/src/CACHE \
104-
&& chmod g+w /home/wger/static/CACHE \
105-
&& sed -i "/^MEDIA_ROOT/c\MEDIA_ROOT='\/home\/wger\/media'" settings.py \
106-
&& echo STATIC_ROOT=\'/home/wger/static\' >> settings.py
107118

108119
USER root
109-
RUN apt-get remove build-essential -y \
110-
&& apt autoremove -y \
111-
&& chown :www-data -R /home/wger/db \
120+
RUN chown :www-data -R /home/wger/db \
121+
&& chown www-data:www-data -R /home/wger/static \
112122
&& chmod g+w /home/wger/db /home/wger/db/database.sqlite
113123

114-
ENTRYPOINT ["/home/wger/entrypoint.sh"]
124+
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]

extras/docker/demo/entrypoint.sh

Lines changed: 0 additions & 14 deletions
This file was deleted.

extras/docker/development/Dockerfile

Lines changed: 17 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,27 @@
11
#
2-
# Docker image for wger development
2+
# Installs some additional packages needed for development
33
#
4-
# Please consult the README for usage
4+
# Note that this dockerfile is built from the corresponding docker-compose file
55
#
6-
# Note: you MUST build this image from the project's root!
7-
# docker build -f extras/docker/development/Dockerfile --tag wger/server .
8-
#
9-
# To run the container consult https://github.com/wger-project/docker
10-
11-
##########
12-
# Builder
13-
##########
14-
FROM wger/base:latest as builder
15-
ARG DEBIAN_FRONTEND=noninteractive
16-
17-
RUN apt update \
18-
&& apt install --no-install-recommends -y \
19-
build-essential \
20-
python3-dev \
21-
python3-wheel \
22-
pkg-config \
23-
libcairo2-dev \
24-
libjpeg8-dev \
25-
libwebp-dev \
26-
libpq-dev \
27-
rustc \
28-
cargo \
29-
&& pip install --upgrade pip
30-
31-
# Build the necessary python wheels
32-
# Note that the --mount tmpfs is a workaround for https://github.com/rust-lang/cargo/issues/8719
33-
COPY requirements* ./
34-
RUN --mount=type=tmpfs,target=/root/.cargo \
35-
pip3 wheel --no-cache-dir --wheel-dir /wheels -r requirements_docker.txt
366

7+
FROM wger/server:latest
378

9+
USER root
3810

39-
########
40-
# Final
41-
########
42-
FROM wger/base:latest
43-
LABEL maintainer="Roland Geider <roland@geider.net>"
44-
ARG DOCKER_DIR=./extras/docker/development
45-
ENV PATH="/home/wger/.local/bin:$PATH"
46-
47-
EXPOSE 8000
11+
WORKDIR /home/wger/src
12+
RUN apt-get update && \
13+
apt-get install -y \
14+
git \
15+
vim \
16+
yarnpkg \
17+
sassc
4818

19+
COPY ../../../requirements.txt /tmp/requirements.txt
20+
COPY ../../../requirements_dev.txt /tmp/requirements_dev.txt
4921

50-
# Set up the application
51-
WORKDIR /home/wger/src
52-
COPY --chown=wger:wger . /home/wger/src
53-
COPY --from=builder /wheels /wheels
54-
COPY ${DOCKER_DIR}/settings.py /home/wger/src
55-
COPY ${DOCKER_DIR}/settings.py /tmp/
56-
COPY ${DOCKER_DIR}/entrypoint.sh /home/wger/entrypoint.sh
57-
COPY ${DOCKER_DIR}/celery/beat/start /start-beat
58-
COPY ${DOCKER_DIR}/celery/worker/start /start-worker
59-
COPY ${DOCKER_DIR}/celery/flower/start /start-flower
60-
RUN chmod +x /home/wger/entrypoint.sh \
61-
&& chmod +x /start-beat \
62-
&& chmod +x /start-worker \
63-
&& chmod +x /start-flower \
64-
&& pip3 install --no-cache /wheels/* \
65-
&& chown -R wger:wger .
22+
RUN ln -s /usr/bin/yarnpkg /usr/bin/yarn \
23+
&& ln -s /usr/bin/sassc /usr/bin/sass
6624

6725
USER wger
68-
RUN pip3 install -e . \
69-
&& mkdir ~/media \
70-
&& mkdir ~/static \
71-
&& mkdir ~/beat \
72-
&& mkdir ~/db/
73-
74-
CMD ["/home/wger/entrypoint.sh"]
26+
RUN pip3 install --break-system-packages --user -r /tmp/requirements.txt \
27+
&& pip3 install --break-system-packages --user -r /tmp/requirements_dev.txt

0 commit comments

Comments
 (0)