change fields component & handle edit, delete, add data and save & change functional page doctor

This commit is contained in:
Ehsan
2025-07-02 02:12:47 +03:30
4 changed files with 24 additions and 11 deletions
+5 -5
View File
@@ -1,7 +1,7 @@
# Dockerfile for Next.js 14 - Optimized for Production # Dockerfile for Next.js 14 - Optimized for Production
# Use the official Node.js image with Alpine Linux for a smaller footprint # Use the official Node.js image with Alpine Linux for a smaller footprint
FROM node:20-alpine AS base FROM node:22-alpine AS base
# Set the working directory in the container # Set the working directory in the container
WORKDIR /app WORKDIR /app
@@ -10,23 +10,23 @@ WORKDIR /app
COPY package*.json ./ COPY package*.json ./
# Install dependencies - leveraging Docker cache # Install dependencies - leveraging Docker cache
RUN npm install --production --frozen-lockfile || yarn install --production --frozen-lockfile RUN npm i --force
# Copy the rest of the application code # Copy the rest of the application code
COPY . . COPY . .
# Build the Next.js application # Build the Next.js application
RUN npm run build || yarn build RUN npm run build
# Stage 2: Production image - smaller and leaner # Stage 2: Production image - smaller and leaner
FROM node:20-alpine AS runner FROM node:22-alpine AS runner
# Set the working directory # Set the working directory
WORKDIR /app WORKDIR /app
# Set environment variables # Set environment variables
ENV NODE_ENV production ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1 # Opt-out of Next.js telemetry ENV NEXT_TELEMETRY_DISABLED 1
# Add a non-root user for security # Add a non-root user for security
RUN addgroup -g 1001 -S nodejs RUN addgroup -g 1001 -S nodejs
@@ -101,7 +101,6 @@ function Form({ insurance, errors, changeData, information }) {
updateData={(name, val) => { updateData={(name, val) => {
changeData([Number(val.id)], name); changeData([Number(val.id)], name);
}} }}
// value={findVal(insurance, "basic_insurance", true)?.name}
value={insurance?.find( value={insurance?.find(
(g) => (g) =>
Number(g.id) === Number(g.id) ===
@@ -127,8 +126,6 @@ function Form({ insurance, errors, changeData, information }) {
changeData={changeData} changeData={changeData}
data={information?.insurance_id} data={information?.insurance_id}
name="insurance_id" name="insurance_id"
// data={information?.supplementary_insurance}
// name="supplementary_insurance"
/> />
</Content> </Content>
<Content error={errors?.blood_type} title="گروه خونی"> <Content error={errors?.blood_type} title="گروه خونی">
+3 -2
View File
@@ -13,11 +13,12 @@ services:
- NEXT_PUBLIC_CLIENT_ID=${NEXT_PUBLIC_CLIENT_ID} - NEXT_PUBLIC_CLIENT_ID=${NEXT_PUBLIC_CLIENT_ID}
- NEXT_PUBLIC_CLIENT_SECRET=${NEXT_PUBLIC_CLIENT_SECRET} - NEXT_PUBLIC_CLIENT_SECRET=${NEXT_PUBLIC_CLIENT_SECRET}
restart: unless-stopped restart: unless-stopped
container_name: nobat724-frontend
ports: ports:
- "3001:3000" - "${APP_PORT}:3000"
environment: environment:
- NODE_ENV=production - NODE_ENV=production
- NEXT_TELEMETRY_DISABLED=1 - NEXT_TELEMETRY_DISABLED=1
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL} - NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
- NEXT_PUBLIC_CLIENT_ID=${NEXT_PUBLIC_CLIENT_ID} - NEXT_PUBLIC_CLIENT_ID=${NEXT_PUBLIC_CLIENT_ID}
- NEXT_PUBLIC_CLIENT_SECRET=${NEXT_PUBLIC_CLIENT_SECRET}
- APP_PORT=${APP_PORT}
+16 -1
View File
@@ -1,5 +1,20 @@
[phases.setup] [phases.setup]
nixPkgs = ["nodejs_22"] nixPkgs = ["nodejs_22"]
[phases.install]
cmds = ["npm install --production --frozen-lockfile"]
[phases.build]
cmds = ["npm run build"]
[start] [start]
cmd = "pnpm run start" cmd = "node server.js"
[variables]
NODE_ENV = "production"
NEXT_TELEMETRY_DISABLED = "1"
# These environment variables will need to be set in your deployment platform
# NEXT_PUBLIC_API_URL - Set in deployment platform
# NEXT_PUBLIC_CLIENT_ID - Set in deployment platform
# NEXT_PUBLIC_CLIENT_SECRET - Set in deployment platform