fix(deploy): use bridge nexus IP and add USER root to Dockerfile
Some checks failed
Deploy Canina / deploy (push) Has been cancelled

This commit is contained in:
parsa aghaei 2026-08-15 15:48:35 +03:30
parent 0625b45ca7
commit adcafa1041
4 changed files with 6 additions and 6 deletions

View File

@ -36,6 +36,7 @@ ENV VITE_API_URL=$VITE_API_URL
RUN npm run build
FROM node:20-alpine
USER root
RUN addgroup -S nginx 2>/dev/null || true && adduser -S nginx -G nginx 2>/dev/null || true
RUN mkdir -p /var/log/nginx /var/cache/nginx /run/nginx /etc/nginx/conf.d /etc/nginx/http.d
COPY --from=nginx:alpine /etc/nginx /etc/nginx

View File

@ -25,7 +25,6 @@ services:
build:
context: ./backend
dockerfile: Dockerfile
network: traefik_public
container_name: canino_backend_prod
restart: always
environment:
@ -53,7 +52,6 @@ services:
build:
context: .
dockerfile: Dockerfile
network: traefik_public
args:
NEXT_PUBLIC_API_URL: "https://api.canina.ir/api"
VITE_API_URL: "https://api.canina.ir"

View File

@ -25,7 +25,6 @@ services:
build:
context: ./backend
dockerfile: Dockerfile
network: traefik_public
container_name: canino_backend_stage
restart: always
environment:
@ -53,7 +52,6 @@ services:
build:
context: .
dockerfile: Dockerfile
network: traefik_public
args:
NEXT_PUBLIC_API_URL: "https://stageapi.canina.ir/api"
VITE_API_URL: "https://stageapi.canina.ir"

View File

@ -4,10 +4,13 @@ set -e
export DOCKER_BUILDKIT=1
export COMPOSE_DOCKER_CLI_BUILD=1
# Ensure nexus is connected to default bridge network so docker build can reach it
docker network connect bridge nexus 2>/dev/null || true
# Nexus npm registry
NEXUS_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{break}}{{end}}' nexus 2>/dev/null || true)
NEXUS_IP=$(docker inspect -f '{{.NetworkSettings.Networks.bridge.IPAddress}}' nexus 2>/dev/null || true)
if [ -z "$NEXUS_IP" ]; then
NEXUS_IP="172.18.0.15"
NEXUS_IP="172.17.0.3"
fi
NPM_REGISTRY="http://${NEXUS_IP}:8081/repository/bitchpedar/"