Update frontend Dockerfile for contour with relative paths and adjust docker-compose.yaml to use contour-specific image.

This commit is contained in:
emelinda 2026-07-23 17:25:25 +03:00
parent 4d9b1807bf
commit 75c47e932f
2 changed files with 10 additions and 1 deletions

View File

@ -324,7 +324,7 @@ services:
condition: service_completed_successfully
frontend:
image: ${SAREX_FRONTEND_IMAGE:-cr.yandex/crp3ccidau046kdj8g9q/sarex-frontend-dev:latest}
image: ${SAREX_FRONTEND_IMAGE:-cr.yandex/crp3ccidau046kdj8g9q/frontend:contour_42138486}
container_name: sarex-frontend
restart: unless-stopped
ports:

9
frontend/Dockerfile Normal file
View File

@ -0,0 +1,9 @@
# Патч прод-образа фронтенда под contour: вырезаем абсолютные хосты в бандле,
# чтобы запросы шли относительными путями (same-origin, через наш nginx).
FROM cr.yandex/crp3ccidau046kdj8g9q/frontend:production_42138486
ENV DIST_PATH=/opt/react_client/static
RUN find $DIST_PATH -type f -name "*.js" -exec sed -i 's|https://api.sarex.io||g' {} + ; \
find $DIST_PATH -type f -name "*.js" -exec sed -i 's|https://lk.sarex.io||g' {} + ; \
find $DIST_PATH -type f -name "*.js" -exec sed -i 's|https://modules.sarex.io||g' {} +