From 20d027c12ae24db21c010df7f028050f02c0a5ac Mon Sep 17 00:00:00 2001 From: Aldino Kemal Date: Sun, 25 May 2025 21:27:09 +0700 Subject: [PATCH] feat: support backward compability This commit introduces a .dockerignore file to exclude unnecessary files from the Docker build context. Additionally, the Dockerfile is updated to set the default command to "rest" when the container starts, ensuring proper execution of the application. --- .dockerignore | 10 ++++++++++ docker/golang.Dockerfile | 4 +++- readme.md | 5 +---- 3 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..66a439b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,10 @@ +.idea +.vscode +.git +.gitignore +.env +.env.local +.env.development +.env.test +.env.production +docker diff --git a/docker/golang.Dockerfile b/docker/golang.Dockerfile index a8bd640..7fea96d 100644 --- a/docker/golang.Dockerfile +++ b/docker/golang.Dockerfile @@ -20,4 +20,6 @@ WORKDIR /app # Copy compiled from builder. COPY --from=builder /app/whatsapp /app/whatsapp # Run the binary. -ENTRYPOINT ["/app/whatsapp"] \ No newline at end of file +ENTRYPOINT ["/app/whatsapp"] + +CMD [ "rest" ] \ No newline at end of file diff --git a/readme.md b/readme.md index c46a65a..cf289aa 100644 --- a/readme.md +++ b/readme.md @@ -159,7 +159,7 @@ make sure you have running MCP server, `./whatsapp mcp` ### Production Mode REST (docker) ```bash -docker run --detach --publish=3000:3000 --name=whatsapp --restart=always --volume=$(docker volume create --name=whatsapp):/app/storages aldinokemal2104/go-whatsapp-web-multidevice rest --autoreply="Dont't reply this message please" +docker run --detach --publish=3000:3000 --name=whatsapp --restart=always --volume=$(docker volume create --name=whatsapp):/app/storages aldinokemal2104/go-whatsapp-web-multidevice --autoreply="Dont't reply this message please" ``` ### Production Mode REST (docker compose) @@ -177,7 +177,6 @@ services: volumes: - whatsapp:/app/storages command: - - rest - --basic-auth=admin:admin - --port=3000 - --debug=true @@ -200,8 +199,6 @@ services: - "3000:3000" volumes: - whatsapp:/app/storages - command: - - rest environment: - APP_BASIC_AUTH=admin:admin - APP_PORT=3000