diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000000..763c421c133d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +node_modules +.next +.github \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000000..f0d69e54df02 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +# Development Docker file +FROM node:18-alpine + +WORKDIR /async + +# Install development dependencies +COPY package.json package-lock.json ./ +RUN npm install + +# Copy the rest of the application files +COPY . . + +# Expose the port for development (if needed) +EXPOSE 3000 + +# Set environment variables for development (optional) +ENV NODE_ENV=development + +CMD ["npm", "run", "dev"] diff --git a/README.md b/README.md index c9eb0a454786..6377621fd54a 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,28 @@ npm run build Generated files of the website go to the `.next` folder. +### Run locally using Docker + +#### Prerequisites: + +- [install Docker](https://docs.docker.com/get-docker/) + + +After cloning repository to your local, perform the following steps from the root of the repository. + +#### Steps: +1. Build the Docker image: + ```bash + docker build -t asyncapi-website .` + ``` +2. Start the container: + ```bash + docker run --rm -it -v "$PWD":/async -p 3000:3000 asyncapi-website + ``` + +Now you're running AsyncAPI website in a development mode. Container is mapped with your local copy of the website. Whenever you make changes to the code, the website will refresh and changes visible in localhost:3000. + + ## Case studies ### Overview