fix(docker): preserve downloaded release source during production build

This commit is contained in:
Christian 2026-03-03 22:19:26 +01:00
parent 8b863a3b68
commit dd02701b21
3 changed files with 31 additions and 3 deletions

View File

@ -38,8 +38,18 @@ RUN if [ "$RELEASE_VERSION" != "latest" ] && [ -n "$GITHUB_TOKEN" ]; then \
pip install --no-cache-dir -r /tmp/requirements.txt; \
fi
# Copy application code
COPY . .
# Copy local source to temp location.
# In release builds we keep downloaded source in /app.
# In latest/local builds we copy from /app_local to /app.
COPY . /app_local
RUN if [ "$RELEASE_VERSION" = "latest" ] || [ -z "$GITHUB_TOKEN" ]; then \
echo "Using local source files..." && \
cp -a /app_local/. /app/; \
else \
echo "Keeping downloaded release source in /app (no local override)"; \
fi && \
rm -rf /app_local
# Create necessary directories
RUN mkdir -p /app/logs /app/uploads /app/static /app/data

18
RELEASE_NOTES_v2.2.40.md Normal file
View File

@ -0,0 +1,18 @@
# Release Notes v2.2.40
Dato: 3. marts 2026
## Hotfix: Production build source override
- Rettet Docker build-flow i `Dockerfile`, så release-kode hentet via `RELEASE_VERSION` ikke bliver overskrevet af lokal checkout under image build.
- Dette løser scenarier hvor produktion kører forkert kodeversion (fx manglende routes som `/dashboard/mission-control`) selv når korrekt release-tag er angivet.
## Tekniske ændringer
- Lokal kildekode kopieres nu til midlertidig mappe (`/app_local`).
- Ved release-build (`RELEASE_VERSION != latest` og token sat) bevares downloadet release-kilde i `/app`.
- Ved local/latest-build kopieres `/app_local` til `/app` som før.
## Verificering
- Build output skal vise:
- `Downloading release ... from Gitea...`
- `Keeping downloaded release source in /app (no local override)`
- Efter deploy skal `/dashboard/mission-control` ikke længere returnere 404 på release v2.2.39+.

View File

@ -1 +1 @@
2.2.39
2.2.40