fix(docker): fix docker-compose startup failures for fresh installs

- Remove dokploy-network external network dependency that breaks
  docker-compose up on fresh installs without the network pre-created
- Fix evolution-manager frontend crash by adding nginx.conf with
  corrected gzip_proxied directive (removes invalid must-revalidate value)
- Add missing POSTGRES_DATABASE, POSTGRES_USERNAME, POSTGRES_PASSWORD
  to .env.example (required by docker-compose postgres service)
- Fix DATABASE_CONNECTION_URI hostname from postgres to evolution-postgres
  to match the docker-compose service name

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
yurii
2026-02-09 14:44:31 +01:00
parent cd800f2976
commit 5dd18451ea
3 changed files with 61 additions and 9 deletions
+7 -1
View File
@@ -52,7 +52,13 @@ DEL_INSTANCE=false
# Provider: postgresql | mysql | psql_bouncer # Provider: postgresql | mysql | psql_bouncer
DATABASE_PROVIDER=postgresql DATABASE_PROVIDER=postgresql
DATABASE_CONNECTION_URI='postgresql://user:pass@postgres:5432/evolution_db?schema=evolution_api' DATABASE_CONNECTION_URI='postgresql://user:pass@evolution-postgres:5432/evolution_db?schema=evolution_api'
# Postgres container settings (used by docker-compose)
POSTGRES_DATABASE=evolution_db
POSTGRES_USERNAME=user
POSTGRES_PASSWORD=pass
# Client name for the database connection # Client name for the database connection
# It is used to separate an API installation from another that uses the same database. # It is used to separate an API installation from another that uses the same database.
DATABASE_CONNECTION_CLIENT_NAME=evolution_exchange DATABASE_CONNECTION_CLIENT_NAME=evolution_exchange
+3 -8
View File
@@ -14,7 +14,6 @@ services:
- evolution_instances:/evolution/instances - evolution_instances:/evolution/instances
networks: networks:
- evolution-net - evolution-net
- dokploy-network
env_file: env_file:
- .env - .env
expose: expose:
@@ -26,6 +25,8 @@ services:
restart: always restart: always
ports: ports:
- "3000:80" - "3000:80"
volumes:
- ./nginx.conf:/etc/nginx/conf.d/nginx.conf:ro
networks: networks:
- evolution-net - evolution-net
@@ -41,9 +42,6 @@ services:
evolution-net: evolution-net:
aliases: aliases:
- evolution-redis - evolution-redis
dokploy-network:
aliases:
- evolution-redis
expose: expose:
- "6379" - "6379"
@@ -67,7 +65,6 @@ services:
- postgres_data:/var/lib/postgresql/data - postgres_data:/var/lib/postgresql/data
networks: networks:
- evolution-net - evolution-net
- dokploy-network
expose: expose:
- "5432" - "5432"
@@ -79,6 +76,4 @@ volumes:
networks: networks:
evolution-net: evolution-net:
name: evolution-net name: evolution-net
driver: bridge driver: bridge
dokploy-network:
external: true
+51
View File
@@ -0,0 +1,51 @@
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
# Gzip compression
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_proxied expired no-cache no-store private auth;
gzip_types
text/plain
text/css
text/xml
text/javascript
application/javascript
application/xml+rss
application/json;
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
add_header Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline'" always;
# Handle client routing
location / {
try_files $uri $uri/ /index.html;
}
# Cache static assets
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# Cache HTML files for a shorter period
location ~* \.html$ {
expires 1h;
add_header Cache-Control "public";
}
# Health check endpoint
location /health {
access_log off;
return 200 "healthy\n";
add_header Content-Type text/plain;
}
}