Compare commits
4 Commits
41bbe87b4c
...
89ec3584f9
| Author | SHA1 | Date | |
|---|---|---|---|
|
89ec3584f9
|
|||
|
8dded6383e
|
|||
|
c47fc48533
|
|||
|
b6d470590e
|
@@ -41,6 +41,14 @@ PUBLIC_BASE_URL=http://localhost:8000
|
|||||||
CORS_ORIGINS=["http://localhost:5173","http://localhost:3000"]
|
CORS_ORIGINS=["http://localhost:5173","http://localhost:3000"]
|
||||||
VITE_API_BASE=
|
VITE_API_BASE=
|
||||||
|
|
||||||
|
# Optional frontend build network and npm fetch tuning:
|
||||||
|
DOCKER_BUILD_NETWORK=default
|
||||||
|
NPM_REGISTRY=https://registry.npmjs.org/
|
||||||
|
NPM_FETCH_RETRIES=5
|
||||||
|
NPM_FETCH_RETRY_MINTIMEOUT=20000
|
||||||
|
NPM_FETCH_RETRY_MAXTIMEOUT=120000
|
||||||
|
NPM_FETCH_TIMEOUT=300000
|
||||||
|
|
||||||
# Production baseline overrides (set explicitly for live deployments):
|
# Production baseline overrides (set explicitly for live deployments):
|
||||||
# APP_ENV=production
|
# APP_ENV=production
|
||||||
# HOST_BIND_IP=127.0.0.1
|
# HOST_BIND_IP=127.0.0.1
|
||||||
|
|||||||
@@ -42,6 +42,25 @@ Tail logs:
|
|||||||
docker compose logs -f
|
docker compose logs -f
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Frontend Build Network Resilience
|
||||||
|
|
||||||
|
The frontend Dockerfile uses `node:22-slim` by default for improved npm network compatibility on IPv4-only Linux hosts.
|
||||||
|
|
||||||
|
The frontend image build supports npm fetch tuning through environment-driven compose build args:
|
||||||
|
|
||||||
|
- `NPM_REGISTRY` (default `https://registry.npmjs.org/`)
|
||||||
|
- `NPM_FETCH_RETRIES` (default `5`)
|
||||||
|
- `NPM_FETCH_RETRY_MINTIMEOUT` (default `20000`)
|
||||||
|
- `NPM_FETCH_RETRY_MAXTIMEOUT` (default `120000`)
|
||||||
|
- `NPM_FETCH_TIMEOUT` (default `300000`)
|
||||||
|
- `DOCKER_BUILD_NETWORK` (default `default`; set to `host` on Linux hosts when bridge-network npm fetches time out)
|
||||||
|
|
||||||
|
If frontend dependency downloads fail with npm `ETIMEDOUT` during `docker compose build`, keep defaults first, then try:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
DOCKER_BUILD_NETWORK=host docker compose build --no-cache frontend
|
||||||
|
```
|
||||||
|
|
||||||
## Authentication Model
|
## Authentication Model
|
||||||
|
|
||||||
- Legacy shared build-time frontend token behavior was removed.
|
- Legacy shared build-time frontend token behavior was removed.
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ services:
|
|||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 10
|
retries: 10
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:7-alpine
|
image: redis:7-alpine
|
||||||
@@ -32,6 +33,7 @@ services:
|
|||||||
- "--enable-cors"
|
- "--enable-cors"
|
||||||
volumes:
|
volumes:
|
||||||
- typesense-data:/data
|
- typesense-data:/data
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
api:
|
api:
|
||||||
build:
|
build:
|
||||||
@@ -68,8 +70,8 @@ services:
|
|||||||
TYPESENSE_PORT: 8108
|
TYPESENSE_PORT: 8108
|
||||||
TYPESENSE_API_KEY: ${TYPESENSE_API_KEY:?TYPESENSE_API_KEY must be set}
|
TYPESENSE_API_KEY: ${TYPESENSE_API_KEY:?TYPESENSE_API_KEY must be set}
|
||||||
TYPESENSE_COLLECTION_NAME: documents
|
TYPESENSE_COLLECTION_NAME: documents
|
||||||
ports:
|
# ports:
|
||||||
- "${HOST_BIND_IP:-127.0.0.1}:8000:8000"
|
# - "${HOST_BIND_IP:-127.0.0.1}:8000:8000"
|
||||||
security_opt:
|
security_opt:
|
||||||
- no-new-privileges:true
|
- no-new-privileges:true
|
||||||
cap_drop:
|
cap_drop:
|
||||||
@@ -84,6 +86,10 @@ services:
|
|||||||
condition: service_started
|
condition: service_started
|
||||||
typesense:
|
typesense:
|
||||||
condition: service_started
|
condition: service_started
|
||||||
|
networks:
|
||||||
|
npm_proxy:
|
||||||
|
ipv4_address: 192.168.98.41
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
worker:
|
worker:
|
||||||
build:
|
build:
|
||||||
@@ -123,14 +129,22 @@ services:
|
|||||||
condition: service_started
|
condition: service_started
|
||||||
typesense:
|
typesense:
|
||||||
condition: service_started
|
condition: service_started
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
build:
|
build:
|
||||||
context: ./frontend
|
context: ./frontend
|
||||||
|
network: ${DOCKER_BUILD_NETWORK:-default}
|
||||||
|
args:
|
||||||
|
NPM_REGISTRY: ${NPM_REGISTRY:-https://registry.npmjs.org/}
|
||||||
|
NPM_FETCH_RETRIES: ${NPM_FETCH_RETRIES:-5}
|
||||||
|
NPM_FETCH_RETRY_MINTIMEOUT: ${NPM_FETCH_RETRY_MINTIMEOUT:-20000}
|
||||||
|
NPM_FETCH_RETRY_MAXTIMEOUT: ${NPM_FETCH_RETRY_MAXTIMEOUT:-120000}
|
||||||
|
NPM_FETCH_TIMEOUT: ${NPM_FETCH_TIMEOUT:-300000}
|
||||||
environment:
|
environment:
|
||||||
VITE_API_BASE: ${VITE_API_BASE:-}
|
VITE_API_BASE: ${VITE_API_BASE:-}
|
||||||
ports:
|
# ports:
|
||||||
- "${HOST_BIND_IP:-127.0.0.1}:5173:5173"
|
# - "${HOST_BIND_IP:-127.0.0.1}:5173:5173"
|
||||||
volumes:
|
volumes:
|
||||||
- ./frontend/src:/app/src
|
- ./frontend/src:/app/src
|
||||||
- ./frontend/index.html:/app/index.html
|
- ./frontend/index.html:/app/index.html
|
||||||
@@ -142,9 +156,17 @@ services:
|
|||||||
- no-new-privileges:true
|
- no-new-privileges:true
|
||||||
cap_drop:
|
cap_drop:
|
||||||
- ALL
|
- ALL
|
||||||
|
networks:
|
||||||
|
npm_proxy:
|
||||||
|
ipv4_address: 192.168.98.40
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
db-data:
|
db-data:
|
||||||
redis-data:
|
redis-data:
|
||||||
dcm-storage:
|
dcm-storage:
|
||||||
typesense-data:
|
typesense-data:
|
||||||
|
|
||||||
|
networks:
|
||||||
|
npm_proxy:
|
||||||
|
external: true
|
||||||
|
|||||||
@@ -1,10 +1,21 @@
|
|||||||
FROM node:22-alpine
|
FROM node:22-slim
|
||||||
|
|
||||||
|
ARG NPM_REGISTRY=https://registry.npmjs.org/
|
||||||
|
ARG NPM_FETCH_RETRIES=5
|
||||||
|
ARG NPM_FETCH_RETRY_MINTIMEOUT=20000
|
||||||
|
ARG NPM_FETCH_RETRY_MAXTIMEOUT=120000
|
||||||
|
ARG NPM_FETCH_TIMEOUT=300000
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package.json /app/package.json
|
COPY package.json /app/package.json
|
||||||
COPY package-lock.json /app/package-lock.json
|
COPY package-lock.json /app/package-lock.json
|
||||||
RUN npm ci
|
RUN npm config set registry "${NPM_REGISTRY}" \
|
||||||
|
&& npm config set fetch-retries "${NPM_FETCH_RETRIES}" \
|
||||||
|
&& npm config set fetch-retry-mintimeout "${NPM_FETCH_RETRY_MINTIMEOUT}" \
|
||||||
|
&& npm config set fetch-retry-maxtimeout "${NPM_FETCH_RETRY_MAXTIMEOUT}" \
|
||||||
|
&& npm config set fetch-timeout "${NPM_FETCH_TIMEOUT}" \
|
||||||
|
&& NODE_OPTIONS=--dns-result-order=ipv4first npm ci --no-audit
|
||||||
RUN chown -R node:node /app
|
RUN chown -R node:node /app
|
||||||
|
|
||||||
COPY --chown=node:node tsconfig.json /app/tsconfig.json
|
COPY --chown=node:node tsconfig.json /app/tsconfig.json
|
||||||
|
|||||||
Reference in New Issue
Block a user