Skip to content

Commit 0bee942

Browse files
Feature/docker support (#4)
* feat: Add Docker support for the application This commit introduces comprehensive Docker support to streamline the development and deployment process. Key changes include: - A `Dockerfile` that containerizes the application using the efficient `node:20-alpine` base image. It sets up the working directory, installs dependencies, and configures the application to run on container start. - A `.dockerignore` file to exclude unnecessary files like `node_modules` and `.git` from the build context, resulting in a smaller and more secure image. - A `docker-compose.yml` file to simplify running the application. It defines the service, manages environment variables with sensible defaults, maps ports, and configures named volumes for `sessions` and `uploads` to ensure data persistence across container restarts. - The `README.md` has been updated with a new "Running with Docker" section, providing clear, step-by-step instructions for getting the application running with both Docker Compose (recommended) and manual Docker commands. The commands have been updated to use the modern `docker compose` syntax. * feat: Add Docker support for the application This commit introduces comprehensive Docker support to streamline the development and deployment process. Key changes include: - A `Dockerfile` that containerizes the application using the efficient `node:20-alpine` base image. It sets up the working directory, installs dependencies, and configures the application to run on container start. - A `.dockerignore` file to exclude unnecessary files like `node_modules` and `.git` from the build context, resulting in a smaller and more secure image. - A `docker-compose.yml` file to simplify running the application. It defines the service, manages environment variables with sensible defaults, maps ports, and configures named volumes for `sessions` and `uploads` to ensure data persistence across container restarts. - The `README.md` has been updated with a new "Running with Docker" section, providing clear, step-by-step instructions for getting the application running with Docker Compose, a pre-built Docker Hub image, and manual Docker commands. The commands have been updated to use the modern `docker compose` syntax. --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
1 parent b243561 commit 0bee942

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

‎README.md‎

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,31 @@ This is the easiest way to get started.
8686
docker compose down
8787
```
8888
89-
### **2. Using Docker (Manual)**
89+
### **2. Using the Pre-built Docker Hub Image**
90+
91+
If you don't want to build the image from the source, you can use the pre-built image from Docker Hub.
92+
93+
1. **Pull the Image**:
94+
```bash
95+
docker pull codegres/simple-whatsapp-api:latest
96+
```
97+
98+
2. **Run the Image**:
99+
You still need to provide the environment variables and mount the volumes.
100+
101+
```bash
102+
docker run -d \
103+
-p 3000:3000 \
104+
-e MASTER_API_KEY="yoursecretkey" \
105+
-e PORT="3000" \
106+
--name whatsapp-api-container \
107+
-v whatsapp_sessions:/usr/src/app/sessions \
108+
-v whatsapp_uploads:/usr/src/app/uploads \
109+
codegres/simple-whatsapp-api:latest
110+
```
111+
112+
### **3. Using Docker (Manual Build)**
113+
90114
91115
If you prefer not to use Docker Compose, you can build and run the container manually.
92116

0 commit comments

Comments
 (0)