From 4b6b87f8e944cd15379242039cc301892e4e3467 Mon Sep 17 00:00:00 2001 From: AmirHossein Mahmoodi Date: Mon, 5 May 2025 14:34:39 +0330 Subject: [PATCH 1/3] add docker --- Dockerfile | 33 +++++++++++++++++++++++++++++++++ docker-compose.yml | 13 +++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b494d6d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +FROM node:22-alpine AS builder + +WORKDIR /app + +RUN npm install -g pnpm + +COPY pnpm-lock.yaml ./ +COPY package.json ./ + +RUN pnpm install --frozen-lockfile + +COPY . . + +RUN pnpm build + +FROM node:22-alpine AS runner + +WORKDIR /app + +ENV NODE_ENV=production + +RUN npm install -g pnpm + +COPY --from=builder /app/public ./public +COPY --from=builder /app/.next ./.next +COPY --from=builder /app/node_modules ./node_modules +COPY --from=builder /app/package.json ./package.json +COPY --from=builder /app/next.config.js ./next.config.js +COPY --from=builder /app/app ./app + +EXPOSE 3000 + +CMD ["pnpm", "start"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..639d220 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3.8' + +services: + nextjs: + build: + context: . + dockerfile: Dockerfile + container_name: nextjs-app + ports: + - "3000:3000" + env_file: + - .env.local + restart: unless-stopped \ No newline at end of file From ef2d8e0fbfb0f9d1a1b8d970857f0cf14e4d0c94 Mon Sep 17 00:00:00 2001 From: AmirHossein Mahmoodi Date: Mon, 5 May 2025 14:39:52 +0330 Subject: [PATCH 2/3] add docker --- docker-compose.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 639d220..7f34faf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,6 +6,10 @@ services: context: . dockerfile: Dockerfile container_name: nextjs-app + environment: + - NEXT_PUBLIC_VERSION=${NEXT_PUBLIC_VERSION} + - NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL} + - NEXT_PUBLIC_SERVER_SOCKET_URL=${NEXT_PUBLIC_SERVER_SOCKET_URL} ports: - "3000:3000" env_file: From 39ba493b73247fe9300c8cd7a37698af7d38af13 Mon Sep 17 00:00:00 2001 From: AmirHossein Mahmoodi Date: Mon, 5 May 2025 14:40:29 +0330 Subject: [PATCH 3/3] change version to 2.1.0 --- example.env.local | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example.env.local b/example.env.local index 7a4dbd6..ab2e819 100644 --- a/example.env.local +++ b/example.env.local @@ -1,4 +1,4 @@ -NEXT_PUBLIC_VERSION = "2.0.0" +NEXT_PUBLIC_VERSION = "2.1.0" NEXT_PUBLIC_API_URL = "https://crm.witel.ir/server" NEXT_PUBLIC_SERVER_SOCKET_URL = "wss://crm.witel.ir"