From 3f50b56640edd52e397377b3967336f3c4d64f9b Mon Sep 17 00:00:00 2001 From: unknown91tech Date: Sun, 6 Oct 2024 18:08:36 +0530 Subject: [PATCH 1/3] added the docker file --- DesignDeck | 1 - Dockerfile | 13 +++++++++++++ README.md | 22 ++++++++++++++++++++++ docker-compose.yml | 22 ++++++++++++++++++++++ next.config.mjs | 10 +++++++--- 5 files changed, 64 insertions(+), 4 deletions(-) delete mode 160000 DesignDeck create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/DesignDeck b/DesignDeck deleted file mode 160000 index 817c999..0000000 --- a/DesignDeck +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 817c999adceb334e0cab66e87cf7f6b60f596c7f diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ff3c3e1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM node:20-alpine + +WORKDIR /nextapp + +COPY package* . + +RUN npm install + +COPY . . + +EXPOSE 3000 + +CMD ["npm" , "run" , "dev"] diff --git a/README.md b/README.md index ba7f834..c2b5f84 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,28 @@ npm run dev Open your web browser and visit http://localhost:3000 to see the website in action during development. +## Running the Project Locally Using Docker + +You can also run DesignDeck locally using Docker by following these steps: + +1. Make sure you have Docker installed on your machine. + +2. Go to the `docker-compose.yml` file in the root of your project and put your api key in this section: + +```bash + environment: + NEXT_PUBLIC_LIVEBLOCKS_PUBLIC_KEY: your_api_key_goes_here +``` + +3. To start the application using Docker, run the following command in your terminal: + +```bash +docker-compose up --build +``` + +This command builds the image and starts the container. You can then access the application at `http://localhost:3000`. + + ## CONTRIBUTING We welcome contributions to DesignDeck! To contribute: diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..148d194 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + web: + image: nextapp + build: + context: . # Use the current directory + dockerfile: Dockerfile + command: sh -c "npm i && npm run dev" + restart: always # Specify the Dockerfile + ports: + - "3000:3000" # Map port 3000 + volumes: + - ./app:/nextapp/app + - ./components:/nextapp/components + - ./constants:/nextapp/constants + - ./hooks:/nextapp/hooks + - ./lib:/nextapp/lib + - ./public:/nextapp/public + - ./types:/nextapp/types # Bind mount the current directory to /nextapp in the container + environment: + NEXT_PUBLIC_LIVEBLOCKS_PUBLIC_KEY: your_api_key_goes_here diff --git a/next.config.mjs b/next.config.mjs index c3da61b..41f53b2 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,18 +1,22 @@ /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, + swcMinify: true, experimental: { appDir: true, esmExternals: "loose", }, - webpack: (config) => { + webpack: (config, context ) => { config.externals.push({ "utf-8-validate": "commonjs utf-8-validate", bufferutil: "commonjs bufferutil", canvas: "canvas", }); - - return config; + config.watchOptions = { + poll: 1000, + aggregateTimeout: 300, + } + return config }, images: { remotePatterns: [ From ba6bee8cf37b608d6551f6a0856d75f455da46c2 Mon Sep 17 00:00:00 2001 From: unknown91tech Date: Sun, 6 Oct 2024 21:45:25 +0530 Subject: [PATCH 2/3] added .dockerignore --- .dockerignore | 2 ++ docker-compose.yml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..1380c2e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +node_modules +.next \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 148d194..12598ab 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,4 +19,4 @@ services: - ./public:/nextapp/public - ./types:/nextapp/types # Bind mount the current directory to /nextapp in the container environment: - NEXT_PUBLIC_LIVEBLOCKS_PUBLIC_KEY: your_api_key_goes_here + NEXT_PUBLIC_LIVEBLOCKS_PUBLIC_KEY: pk_prod_nBePGipaevdjDEjUI9WVbQTrkS_mBnNBm3oVcReU8O1TYJkVFCOdZF8Q0XoJYKdU From fd900c49f4ddb103c5140fc5be9869f7fcf7d863 Mon Sep 17 00:00:00 2001 From: unknown91tech Date: Sun, 6 Oct 2024 21:46:26 +0530 Subject: [PATCH 3/3] added .dockerignore hidden --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 12598ab..148d194 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,4 +19,4 @@ services: - ./public:/nextapp/public - ./types:/nextapp/types # Bind mount the current directory to /nextapp in the container environment: - NEXT_PUBLIC_LIVEBLOCKS_PUBLIC_KEY: pk_prod_nBePGipaevdjDEjUI9WVbQTrkS_mBnNBm3oVcReU8O1TYJkVFCOdZF8Q0XoJYKdU + NEXT_PUBLIC_LIVEBLOCKS_PUBLIC_KEY: your_api_key_goes_here