1
0
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity Security Code Quality

Change docker file

This commit is contained in:
2025-07-10 10:47:51 +07:00
parent 1d505b8639
commit 280f84ca4e
4 changed files with 16 additions and 11 deletions

3
.dockerignore Normal file
View File

@@ -0,0 +1,3 @@
.git
.next
node_modules

View File

@@ -9,8 +9,10 @@ ARG MONGODB_DB
WORKDIR /app
# Install dependencies
COPY package.json package-lock.json* ./
RUN npm ci
COPY package.json ./
RUN apk add --no-cache libc6-compat
RUN rm -rf node_modules package-lock.json yarn.lock pnpm-lock.yaml
RUN npm install --omit=dev
# Copy the rest of the application
COPY . .

View File

@@ -1,4 +1,4 @@
version: '3.9'
version: "3.9"
services:
app:
@@ -7,7 +7,7 @@ services:
dockerfile: Dockerfile
container_name: cosmos-crm
ports:
- '3000:3000'
- "3000:3000"
environment:
- NODE_ENV=development
- MONGODB_URI=mongodb://mongo:27017
@@ -19,7 +19,7 @@ services:
image: mongo:7
container_name: mongo
ports:
- '27017:27017'
- "27017:27017"
volumes:
- mongo-data:/data/db

View File

@@ -3,14 +3,14 @@ import { db } from "@/database/database";
export async function GET(
request: NextRequest,
{ params }: { params: { id: string } }
{ params }: { params: Promise<{ id: string }> }
) {
try {
// Initialize database
await db.read();
// Parse dependant ID from params
const dependantId = parseInt(params.id);
const dependantId = parseInt((await params).id);
if (isNaN(dependantId)) {
return NextResponse.json(
@@ -61,14 +61,14 @@ export async function GET(
export async function PUT(
request: NextRequest,
{ params }: { params: { id: string } }
{ params }: { params: Promise<{ id: string }> }
) {
try {
// Initialize database
await db.read();
// Parse dependant ID from params
const dependantId = parseInt(params.id);
const dependantId = parseInt((await params).id);
if (isNaN(dependantId)) {
return NextResponse.json(
@@ -141,14 +141,14 @@ export async function PUT(
export async function DELETE(
request: NextRequest,
{ params }: { params: { id: string } }
{ params }: { params: Promise<{ id: string }> }
) {
try {
// Initialize database
await db.read();
// Parse dependant ID from params
const dependantId = parseInt(params.id);
const dependantId = parseInt((await params).id);
if (isNaN(dependantId)) {
return NextResponse.json(