Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions docker-compose.mwanga.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
services:
api:
container_name: evolution_api
image: evoapicloud/evolution-api:latest
restart: always
depends_on:
- redis
- evolution_postgres
ports:
- "8080:8080"
env_file:
- .env
networks:
Comment on lines +4 to +13
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Using latest tags for images can make deployments non-reproducible and harder to debug.

For both api and redis, please pin images to specific versions or digests (e.g. evoapicloud/evolution-api:1.2.3, redis:7.2) so updates are explicit and controlled.

Suggested implementation:

    image: evoapicloud/evolution-api:1.2.3

    image: redis:7.2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (bug_risk): Lack of a volume for Postgres means database data will be lost when the container is removed.

If this is meant for more than disposable local testing, define a named volume for evolution_postgres (e.g. volumes: [evolution_postgres_data:/var/lib/postgresql/data]) so data persists across container recreations and docker-compose down runs.

Suggested implementation:

  evolution_postgres:
    container_name: evolution_postgres
    image: postgres:15
    volumes:
      - evolution_postgres_data:/var/lib/postgresql/data

You also need to declare the named volume evolution_postgres_data at the top level of the compose file, for example:

volumes:
  evolution_postgres_data:

Place this alongside the existing top-level services: / networks: keys (not nested under a service). If there is already a volumes: section, just add evolution_postgres_data: under it instead of creating a new volumes: key.

- evolution-net

redis:
container_name: evolution_redis
image: redis:latest
restart: always
networks:
- evolution-net

evolution_postgres:
container_name: evolution_postgres
image: postgres:15
restart: always
env_file:
- .env
environment:
- POSTGRES_DB=evolution_db
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres_pass
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 issue (security): Hard-coding the database password in the compose file is a security risk.

Even for local use, embedding POSTGRES_PASSWORD in the compose file makes it easy to leak via version control or shared configs. Since you already use .env, reference the variable instead (e.g., POSTGRES_PASSWORD=${POSTGRES_PASSWORD}) and keep the actual secret only in .env or your secrets manager.

networks:
- evolution-net

networks:
evolution-net:
driver: bridge