Skip to content

Commit

Permalink
Merge pull request #43 from unknown91tech/docker-added
Browse files Browse the repository at this point in the history
added the docker file
  • Loading branch information
jahnvisahni31 authored Oct 7, 2024
2 parents c5cfa6e + fd900c4 commit f8875ce
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.next
1 change: 0 additions & 1 deletion DesignDeck
Submodule DesignDeck deleted from 817c99
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:20-alpine

WORKDIR /nextapp

COPY package* .

RUN npm install

COPY . .

EXPOSE 3000

CMD ["npm" , "run" , "dev"]
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
22 changes: 22 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 7 additions & 3 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -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: [
Expand Down

0 comments on commit f8875ce

Please sign in to comment.