mirror of
https://github.com/kevinveenbirkenbach/homepage.veen.world.git
synced 2026-05-14 09:15:32 +00:00
Replace the host-side `make npm-install` step with a compose-level `command:` override that runs `npm install` inside the container on every start. Back node_modules and static/vendor with named volumes so the bind-mounted source tree no longer shadows the install while state still survives container restarts. Drop the now-redundant npm-install target and its references in up/dev/prod/test-e2e. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
25 lines
600 B
YAML
25 lines
600 B
YAML
version: '3.8'
|
|
|
|
services:
|
|
portfolio:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: portfolio
|
|
ports:
|
|
- "${PORT:-5000}:${PORT:-5000}"
|
|
env_file:
|
|
- .env
|
|
volumes:
|
|
- ./app:/app
|
|
- node_modules:/app/node_modules
|
|
- vendor:/app/static/vendor
|
|
# Run `npm install` on every container start so the named volumes
|
|
# reflect the current package.json (postinstall regenerates vendor/).
|
|
command: sh -c "npm install --prefix /app --no-audit --no-fund && python app.py"
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
node_modules:
|
|
vendor:
|