Compare commits

...

6 commits

Author SHA1 Message Date
8590a295a8 Merge branch 'docker-image' into 'develop'
Docker image

See merge request la-chariotte/la-chariotte!119
2024-11-05 11:19:52 +00:00
3d38bb56c0 Populate the changelog and bump the version to 1.3.0 2024-11-05 11:00:21 +00:00
Ploc
99db86153d refactor: change license file from text to markdown
Change license file from text to markdown as markdown adds some markup that makes it easier to read than text.
2024-11-02 15:04:01 +00:00
Ploc
8741d6d9b6 fix: license text
Copy license text from https://www.gnu.org/licenses/agpl-3.0.txt
2024-11-02 15:04:01 +00:00
9f8be6d52d
Use granian as a WSGI server 2024-10-24 01:20:52 +02:00
5a4260ed42
Update Dockerfile to use uv 2024-10-24 00:18:55 +02:00
5 changed files with 439 additions and 1005 deletions

View file

@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
since 0.4.1, and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## 1.3.0 (2024-11-02)
This is a small release, with a few features and bugfixes. The code is now
hosted on https://framagit.org rather than https://gitlab.com.
### Added
- Changed hour and date format in the generated CSV files
- Added the date in the grouped order dashboard
- Changed the display of the last possible date and hour to place an order
- Added the total number of ordered items in the grouped orders overview
- Removed header line and column for grouped order name in the CSV export for emails
### Fixed
- The "reset password" form is now fixed, it was broken since the last release.
## 1.2.0 (2024-07-12)
A small release, with a few features, a new footer and a `/stats` endpoint.

View file

@ -1,16 +1,81 @@
FROM python:3.11-slim
# Stage 1: General debian environment
FROM debian:stable-slim AS linux-base
WORKDIR /srv/app
# Assure UTF-8 encoding is used.
ENV LC_CTYPE=C.utf8
# Location of the virtual environment
ENV UV_PROJECT_ENVIRONMENT="/venv"
# Location of the python installation via uv
ENV UV_PYTHON_INSTALL_DIR="/python"
# Byte compile the python files on installation
ENV UV_COMPILE_BYTECODE=1
# Python verision to use
ENV UV_PYTHON=python3.12
# Tweaking the PATH variable for easier use
ENV PATH="$UV_PROJECT_ENVIRONMENT/bin:$PATH"
RUN apt update && \
apt install --no-install-recommends -y libpq-dev build-essential curl gcc sassc libpango-1.0-0 libpangoft2-1.0-0 libjpeg-dev libopenjp2-7-dev libffi-dev libpangoft2-1.0-0 libcairo2 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 shared-mime-info gettext &&\
rm -rf /var/lib/apt/lists/*
# Update debian
RUN apt-get update
RUN apt-get upgrade -y
COPY --chown=www-data:www-data . .
# Install general required dependencies
RUN apt-get install --no-install-recommends -y tzdata \
libpango-1.0-0 \
libpangoft2-1.0-0 \
libjpeg-dev \
libopenjp2-7-dev \
libffi-dev \
libpangoft2-1.0-0 \
libcairo2 \
libpangocairo-1.0-0 \
libgdk-pixbuf2.0-0 \
shared-mime-info \
gettext \
tini
run python -m pip install --upgrade pip \
&& python -m pip install uwsgi \
&& python -m pip install -r requirements.txt \
&& python -m pip install .
# Stage 2: Python environment
FROM linux-base AS python-base
ENTRYPOINT [ "uwsgi", "-i", "uwsgi.ini" ]
# Install debian dependencies
RUN apt-get install --no-install-recommends -y \
libpq-dev \
build-essential \
curl \
gcc \
sassc
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
# Create virtual environment and install dependencies
COPY pyproject.toml ./
COPY uv.lock ./
RUN uv sync --frozen --no-dev --no-install-project
RUN uv pip install granian
# Stage 3: Building environment
FROM python-base AS builder-base
WORKDIR /app
COPY . /app
# Build static files
RUN python manage.py compilescss
RUN python manage.py collectstatic --no-input
# Compile translation files
# RUN python manage.py compilemessages
# Stage 4: Webapp environment
FROM linux-base AS webapp
# Copy python, virtual env and static assets
COPY --from=builder-base $UV_PYTHON_INSTALL_DIR $UV_PYTHON_INSTALL_DIR
COPY --from=builder-base $UV_PROJECT_ENVIRONMENT $UV_PROJECT_ENVIRONMENT
COPY --from=builder-base /app /app
# Start the application server
WORKDIR /app
EXPOSE 8000
CMD ["docker/entrypoint.sh"]

1324
LICENSE

File diff suppressed because it is too large Load diff

14
docker/entrypoint.sh Executable file
View file

@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -euxo pipefail
echo "Migrate database..."
python manage.py migrate --settings local_settings
echo "Start server..."
granian la_chariotte.wsgi:application \
--host 127.0.0.1 \
--port 8000 \
--interface wsgi \
--no-ws \
--loop uvloop

View file

@ -1 +1 @@
__version__ = "1.2.0"
__version__ = "1.3.0"