change node version and modify docker compose

This commit is contained in:
SennayT
2026-05-28 14:03:49 +03:00
parent e7bb4db4ce
commit af5f4cd038
4 changed files with 21 additions and 13 deletions

View File

@@ -2,7 +2,7 @@
# Build from monorepo root: docker build -f apps/edr-passenger-api/Dockerfile .
# On start: runs prisma migrate deploy + seed, then the API.
FROM node:22-alpine AS base
FROM node:24.15.0-alpine AS base
RUN apk add --no-cache libc6-compat
RUN corepack enable
WORKDIR /app
@@ -31,7 +31,7 @@ RUN if [ -d node_modules/.prisma ]; then \
cp -r node_modules/.prisma /deploy/node_modules/.prisma; \
fi
FROM node:22-alpine AS runner
FROM node:24.15.0-alpine AS runner
RUN apk add --no-cache libc6-compat
RUN corepack enable && corepack prepare pnpm@11.1.1 --activate
ENV NODE_ENV=production

View File

@@ -13,9 +13,7 @@ services:
secrets:
- npmrc
ports:
- "3001:3001"
environment:
PORT: "3001"
- "${FREIGHT_API_PORT:-3001}:${FREIGHT_API_PORT:-3001}"
env_file:
- apps/edr-freight-api/.env
@@ -24,9 +22,7 @@ services:
context: .
dockerfile: apps/edr-passenger-api/Dockerfile
ports:
- "4000:4000"
environment:
PORT: "4000"
- "${PORT:-4000}:${PORT:-4000}"
env_file:
- apps/edr-passenger-api/.env
@@ -42,7 +38,7 @@ services:
secrets:
- npmrc
ports:
- "5173:80"
- "${PORT:-5173}:80"
freight-backoffice:
build:
@@ -55,7 +51,7 @@ services:
secrets:
- npmrc
ports:
- "5183:80"
- "${PORT:-5183}:80"
passenger-portal:
build:
@@ -66,7 +62,7 @@ services:
APP_PATH: apps/edr-passenger-web/portal
VITE_API_URL: ${PASSENGER_VITE_API_URL:-http://localhost:4000}
ports:
- "5174:80"
- "${PORT:-5174}:80"
passenger-backoffice:
build:
@@ -77,7 +73,7 @@ services:
APP_PATH: apps/edr-passenger-web/backoffice
VITE_API_URL: ${PASSENGER_VITE_API_URL:-http://localhost:4000}
ports:
- "5184:80"
- "${PORT:-5184}:80"
secrets:
npmrc:

View File

@@ -4,7 +4,7 @@ ARG TURBO_FILTER=@edr/freight-portal
ARG APP_PATH=apps/edr-freight-web/portal
ARG VITE_API_URL=http://localhost:3001/api
FROM node:22-alpine AS base
FROM node:24.15.0-alpine AS base
RUN apk add --no-cache libc6-compat
RUN corepack enable
WORKDIR /app

View File

@@ -49,6 +49,18 @@ for service in "$@"; do
mkdir -p "$(dirname "${dest}")"
cp "${src}" "${dest}"
echo "Synced ${src} -> ${dest}"
port_value=$(sed -n -E 's/^[[:space:]]*PORT[[:space:]]*=[[:space:]]*"?([^"#]+)"?[[:space:]]*(#.*)?$/\1/p' "${src}" | head -n1 | tr -d '[:space:]')
if [[ -z "${port_value}" ]]; then
echo "Missing required PORT in env file: ${src}" >&2
exit 1
fi
# if [[ -n "${GITHUB_ENV:-}" ]]; then
# service_var=$(echo "${service}" | tr '[:lower:]-' '[:upper:]_')
# echo "${service_var}_PORT=${port_value}" >> "${GITHUB_ENV}"
# echo "Exported ${service_var}_PORT from ${src}"
# fi
done
# Optional build-time variables (VITE_API_URL, etc.)