Fix Docker build: lockfile, BuildKit DNS, and setuptools build backend

- Generate frontend/package-lock.json (required by npm ci)
- Add network: host to BuildKit build stages to fix DNS in pip installs
- Switch pyproject.toml build backend to setuptools.build_meta (stable)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
curo1305
2026-04-12 15:40:18 +02:00
parent 114df7162f
commit 2351b489fe
4 changed files with 3845 additions and 2 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.backends.legacy:build"
requires = ["setuptools>=45"]
build-backend = "setuptools.build_meta"
[project]
name = "destroying_sap"
+23
View File
@@ -0,0 +1,23 @@
# 2026-04-12 — Fix Docker build issues
**Timestamp:** 2026-04-12T13:40:00
## Summary
Resolved three Docker build failures preventing the dev stack from starting. All three containers (db, backend, frontend) now build and run successfully.
## Issues Fixed
1. **No `package-lock.json`**`npm ci` requires a lockfile. Generated `frontend/package-lock.json` inside a throwaway `node:20-alpine` container (no host installation).
2. **BuildKit DNS failure** — Docker BuildKit build steps had no DNS resolution, causing pip to fail on PyPI connections. Fixed by adding `network: host` to both `backend` and `frontend` build configs in `docker-compose.yml`.
3. **`setuptools.backends.legacy` unavailable** — The `pyproject.toml` referenced a setuptools 68+ only backend path. Changed to the stable `setuptools.build_meta` backend (available since setuptools 40).
## Files Modified
- `docker-compose.yml` — added `network: host` to `backend` and `frontend` build sections
- `backend/pyproject.toml` — changed build backend from `setuptools.backends.legacy:build` to `setuptools.build_meta`; bumped setuptools requirement to `>=45`
- `backend/Dockerfile` — reverted intermediate `--no-build-isolation` workaround (no longer needed)
## Files Added
- `frontend/package-lock.json` — npm lockfile required by `npm ci` in the frontend Dockerfile
+2
View File
@@ -23,6 +23,7 @@ services:
build:
context: ./backend
dockerfile: Dockerfile
network: host
restart: unless-stopped
env_file: ./backend/.env
environment:
@@ -38,6 +39,7 @@ services:
build:
context: ./frontend
dockerfile: Dockerfile
network: host
restart: unless-stopped
ports:
- "80:80"
+3818
View File
File diff suppressed because it is too large Load Diff