Skip to content

Commit

Permalink
Add Docker Compose support and update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Pratikkale26 committed Jan 7, 2025
1 parent 4d002ce commit deba37c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,34 @@ After cloning repository to your local, perform the following steps from the roo

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.
### Run locally using Docker Compose
#### Prerequisites:
- [Install Docker](https://docs.docker.com/get-docker/)
- [Install Docker Compose](https://docs.docker.com/compose/install/)
After cloning the repository to your local system, you can use Docker Compose to simplify the development setup.
#### Steps:
1. Start the development environment with Docker Compose:
```bash
docker-compose up
```
2. Access the website:
- Open your browser and navigate to [http://localhost:3000](http://localhost:3000).
#### Features:
- The `docker-compose.yml` file automatically sets up the container and maps your local code to the container's `/async` directory.
- Any changes you make locally will automatically be reflected in the running application due to volume mounting.
- The `node_modules` directory inside the container is isolated to prevent conflicts with your local system.

To stop the container, press `Ctrl+C` in your terminal or run:
```bash
docker-compose down
## Use shared Markdown fragments
To minimize the duplication of content and make it easier to maintain, there are shared fragments you can use when working with Markdown files. These fragments are stored in the `/assets/docs/fragments` directory.
Expand Down
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3.8'

services:
app:
build:
context: .
dockerfile: Dockerfile # Path to Dockerfile
ports:
- "3000:3000" # Map host port 3000 to container port 3000
volumes:
- .:/async # Mount the current directory to /async in the container - for hot reloading
- /async/node_modules # Exclude node_modules from being overridden
environment:
NODE_ENV: development # it Set environment variable
command: ["npm", "run", "dev"]

0 comments on commit deba37c

Please sign in to comment.