Skip to content

Commit

Permalink
Merge branch 'master' into feature/ingredient-search
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandgeider authored Dec 30, 2024
2 parents 6887068 + c512614 commit 4bc6343
Show file tree
Hide file tree
Showing 165 changed files with 20,468 additions and 24,214 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ updates:
interval: "daily"

- package-ecosystem: "docker"
directory: "/extras/docker/development/"
directory: "/extras/docker/production/"
schedule:
interval: "daily"
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
matrix:
#TODO: pypy3 has problems compiling lxml
python-version: [ '3.10', '3.11', '3.12' ]
python-version: [ '3.10', '3.11', '3.12', '3.13' ]
name: CI job (python ${{ matrix.python-version }})

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@v4

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

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: actions/checkout@v4

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

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -41,4 +41,4 @@ jobs:
push: true
file: extras/docker/demo/Dockerfile
platforms: linux/amd64,linux/arm64
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
tags: ${{ vars.REGISTRY_REPO }}/demo:latest,${{ vars.REGISTRY_REPO }}/demo:2.3-dev
21 changes: 12 additions & 9 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:

env:
REGISTRY_IMAGE: ${{ vars.REGISTRY_REPO }}/server
REGISTRY_IMAGE_ALT: ${{ vars.REGISTRY_REPO }}/devel

jobs:
build-prod:
Expand All @@ -23,6 +22,11 @@ jobs:
- linux/arm/v7
- linux/arm64
steps:
- name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4

Expand All @@ -37,10 +41,9 @@ jobs:
type=raw,value=2.3-dev
images: |
${{ env.REGISTRY_IMAGE }}
${{ env.REGISTRY_IMAGE_ALT }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.1.0
uses: docker/setup-qemu-action@v3.2.0

- name: Set up Docker Buildx
id: buildx
Expand All @@ -67,7 +70,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
file: extras/docker/development/Dockerfile
file: extras/docker/production/Dockerfile
builder: ${{ steps.buildx.outputs.name }}
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
Expand All @@ -85,9 +88,9 @@ jobs:
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: digests
name: digests-${{ env.PLATFORM_PAIR }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
Expand All @@ -103,10 +106,11 @@ jobs:
- build-prod
steps:
- name: Download digests
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: digests
path: /tmp/digests
pattern: digests-*
merge-multiple: true

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -120,7 +124,6 @@ jobs:
type=raw,value=2.3-dev
images: |
${{ env.REGISTRY_IMAGE }}
${{ env.REGISTRY_IMAGE_ALT }}
- name: Login to Docker Hub
uses: docker/login-action@v3
Expand Down
5 changes: 5 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ Developers
* Ethan Winters - https://github.com/ebwinters
* Dieter Plaetinck - https://github.com/Dieterbe
* Jonathan La Field - https://github.com/JLaField
* Kevin Moy - https://github.com/kmoy1
* Taylor Fuller - https://github.com/taylor-fuller
* eyJhb - https://github.com/eyJhb
* Joshua Shelley - https://github.com/navyjosh
* Matt Harrison - https://github.com/Maralai


Translators
Expand Down
59 changes: 17 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,21 @@ width="400">

## Mobile app

[<img src="https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png"
alt="Get it on Google Play"
height="80">](https://play.google.com/store/apps/details?id=de.wger.flutter)
[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png"
alt="Get it on F-Droid"
height="80">](https://f-droid.org/packages/de.wger.flutter/)
[<img src="https://raw.githubusercontent.com/wger-project/wger/master/wger/core/static/images/logos/play-store/badge.svg"
alt="Get it on Google Play" height="60">](https://play.google.com/store/apps/details?id=de.wger.flutter)

## Installation
[<img src="https://developer.apple.com/assets/elements/badges/download-on-the-app-store.svg"
alt="Download on the App Store" height="60">](https://apps.apple.com/us/app/wger-workout-manager/id6502226792)

[<img src="https://raw.githubusercontent.com/wger-project/wger/master/wger/core/static/images/logos/fdroid/get-it-on.png"
alt="Get it on F-Droid" height="70">](https://f-droid.org/packages/de.wger.flutter/)

These are the basic steps to install and run the application locally on a Linux
system. There are more detailed instructions, other deployment options as well
as an administration guide available at <https://wger.readthedocs.io> or in the
[docs repo](https://github.com/wger-project/docs).
[<img src="https://raw.githubusercontent.com/wger-project/wger/master/wger/core/static/images/logos/flathub/black.svg"
alt="Get it on Flathub" height="60">](https://flathub.org/apps/de.wger.flutter)

Please consult the commands' help for further information and available
parameters.
## Installation

### Production
### Production with docker compose

If you want to host your own instance, take a look at the provided docker
compose file. This config will persist your database and uploaded images:
Expand All @@ -50,36 +47,14 @@ If you just want to try it out:

Then just open <http://localhost:8000> and log in as **admin**, password **adminadmin**

Please note that this image will overwrite your data when you pull a new version,
it is only intended as an easy to setup demo

### Development version

We provide a docker file that sets everything up for development (however this won't
persist any data)

````shell script
docker run -ti \
-v /path/to/your/wger/checkout:/home/wger/src \
--name wger.dev \
--publish 8000:8000 \
wger/server
````

Then just open <http://localhost:8000> and log in as: **admin**, password **adminadmin**

For more info, check the [README in wger/extras/developemt](
./extras/docker/development/README.md
).

Alternatively you can use the production compose file for development as well,
just bind your local source code into the web container (see the docker-compose.yml
file for details). You will also probably want to set `DJANGO_DEBUG to false
Please note that this image will not persist any data and overwrite your database
when you pull a new version, it is only intended as an easy to setup demo

#### Local installation
## Documentation

If you prefer a local installation, consult the
[development documentation](https://wger.readthedocs.io/en/latest/development.html)
For instructions on installing a development version and other settings, etc.,
consult the online documentation at <https://wger.readthedocs.io> or in
the [docs repo](https://github.com/wger-project/docs).

## Contact

Expand Down
19 changes: 9 additions & 10 deletions extras/docker/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,32 @@
# docker build --tag wger/base .
#

FROM ubuntu:22.04
FROM ubuntu:24.04

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

# Install dependencies
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update \
&& apt install --no-install-recommends -y \
adduser \
locales \
nodejs \
npm \
python3-pip \
sqlite3 \
wget \
tzdata \
libpq5 \
&& npm install -g yarn sass\
&& locale-gen en_US.UTF-8

# Environmental variables
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1


# Add wger user
RUN adduser wger --disabled-password --gecos ""
RUN deluser ubuntu
RUN adduser wger --uid 1000 --disabled-password --gecos ""
52 changes: 31 additions & 21 deletions extras/docker/demo/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
##########
# Builder
##########
FROM wger/base:latest as builder
FROM wger/base:latest AS builder
ARG DEBIAN_FRONTEND=noninteractive

RUN apt update \
Expand All @@ -32,20 +32,29 @@ RUN apt update \
libpq-dev \
rustc \
cargo \
&& pip install --upgrade pip
yarnpkg \
sassc

# Build the necessary python wheels
# Note that the --mount is a workaround for https://github.com/rust-lang/cargo/issues/8719
COPY requirements* ./
RUN --mount=type=tmpfs,target=/root/.cargo pip3 wheel --no-cache-dir --wheel-dir /wheels -r requirements_docker.txt
RUN --mount=type=tmpfs,target=/root/.cargo pip3 wheel --no-cache-dir --wheel-dir /wheels -r requirements_docker.txt \
&& pip3 install --break-system-packages --user --no-cache-dir /wheels/*

COPY . /home/wger/src
WORKDIR /home/wger/src
RUN ln -s /usr/bin/yarnpkg /usr/bin/yarn \
&& ln -s /usr/bin/sassc /usr/bin/sass \
&& yarn install \
&& yarn build:css:sass


########
# Final
########
FROM wger/base:latest
LABEL maintainer="Roland Geider <roland@geider.net>"

ENV TERM=xterm
ARG DOCKER_DIR=./extras/docker/demo
EXPOSE 80

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

RUN chmod 0644 /etc/cron.d/wger \
&& chmod +x /home/wger/venvwrapper /home/wger/entrypoint.sh \
&& chmod +x /home/wger/venvwrapper \
&& touch /var/log/cron.log

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

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

WORKDIR /home/wger/src
#RUN git clone https://github.com/wger-project/wger.git
RUN python3 -m venv /home/wger/venv

# Change permissions of some files and folders so the apache process
# can access them.
RUN mkdir -p ~/static/CACHE ~/media \
&& ln -s /home/wger/static/CACHE /home/wger/src/CACHE \
&& chmod g+w /home/wger/static/CACHE

RUN . /home/wger/venv/bin/activate \
&& pip install --upgrade pip \
&& pip install --no-cache /wheels/* \
&& pip install -e . \
&& wger create-settings --database-path /home/wger/db/database.sqlite \
&& wger bootstrap \
&& wger load-online-fixtures \
&& sed -i "/^MEDIA_ROOT/c\MEDIA_ROOT='\/home\/wger\/media'" settings.py \
&& echo STATIC_ROOT=\'/home/wger/static\' >> settings.py \
&& wger bootstrap --no-process-static \
&& python3 manage.py sync-exercises \
&& python3 manage.py download-exercise-images
&& wger load-online-fixtures \
&& python3 manage.py download-exercise-images \
&& python3 manage.py collectstatic --no-input


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

USER root
RUN apt-get remove build-essential -y \
&& apt autoremove -y \
&& chown :www-data -R /home/wger/db \
RUN chown :www-data -R /home/wger/db \
&& chown www-data:www-data -R /home/wger/static \
&& chmod g+w /home/wger/db /home/wger/db/database.sqlite

ENTRYPOINT ["/home/wger/entrypoint.sh"]
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]
14 changes: 0 additions & 14 deletions extras/docker/demo/entrypoint.sh

This file was deleted.

Loading

0 comments on commit 4bc6343

Please sign in to comment.