Skip to content

Commit 5dd1845

Browse files
enginerclaude
andcommitted
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>
1 parent cd800f2 commit 5dd1845

File tree

3 files changed

+61
-9
lines changed

3 files changed

+61
-9
lines changed

.env.example

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,13 @@ DEL_INSTANCE=false
5252

5353
# Provider: postgresql | mysql | psql_bouncer
5454
DATABASE_PROVIDER=postgresql
55-
DATABASE_CONNECTION_URI='postgresql://user:pass@postgres:5432/evolution_db?schema=evolution_api'
55+
DATABASE_CONNECTION_URI='postgresql://user:pass@evolution-postgres:5432/evolution_db?schema=evolution_api'
56+
57+
# Postgres container settings (used by docker-compose)
58+
POSTGRES_DATABASE=evolution_db
59+
POSTGRES_USERNAME=user
60+
POSTGRES_PASSWORD=pass
61+
5662
# Client name for the database connection
5763
# It is used to separate an API installation from another that uses the same database.
5864
DATABASE_CONNECTION_CLIENT_NAME=evolution_exchange

docker-compose.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ services:
1414
- evolution_instances:/evolution/instances
1515
networks:
1616
- evolution-net
17-
- dokploy-network
1817
env_file:
1918
- .env
2019
expose:
@@ -26,6 +25,8 @@ services:
2625
restart: always
2726
ports:
2827
- "3000:80"
28+
volumes:
29+
- ./nginx.conf:/etc/nginx/conf.d/nginx.conf:ro
2930
networks:
3031
- evolution-net
3132

@@ -41,9 +42,6 @@ services:
4142
evolution-net:
4243
aliases:
4344
- evolution-redis
44-
dokploy-network:
45-
aliases:
46-
- evolution-redis
4745
expose:
4846
- "6379"
4947

@@ -67,7 +65,6 @@ services:
6765
- postgres_data:/var/lib/postgresql/data
6866
networks:
6967
- evolution-net
70-
- dokploy-network
7168
expose:
7269
- "5432"
7370

@@ -79,6 +76,4 @@ volumes:
7976
networks:
8077
evolution-net:
8178
name: evolution-net
82-
driver: bridge
83-
dokploy-network:
84-
external: true
79+
driver: bridge

nginx.conf

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
server {
2+
listen 80;
3+
server_name localhost;
4+
root /usr/share/nginx/html;
5+
index index.html;
6+
7+
# Gzip compression
8+
gzip on;
9+
gzip_vary on;
10+
gzip_min_length 1024;
11+
gzip_proxied expired no-cache no-store private auth;
12+
gzip_types
13+
text/plain
14+
text/css
15+
text/xml
16+
text/javascript
17+
application/javascript
18+
application/xml+rss
19+
application/json;
20+
21+
# Security headers
22+
add_header X-Frame-Options "SAMEORIGIN" always;
23+
add_header X-XSS-Protection "1; mode=block" always;
24+
add_header X-Content-Type-Options "nosniff" always;
25+
add_header Referrer-Policy "no-referrer-when-downgrade" always;
26+
add_header Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline'" always;
27+
28+
# Handle client routing
29+
location / {
30+
try_files $uri $uri/ /index.html;
31+
}
32+
33+
# Cache static assets
34+
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
35+
expires 1y;
36+
add_header Cache-Control "public, immutable";
37+
}
38+
39+
# Cache HTML files for a shorter period
40+
location ~* \.html$ {
41+
expires 1h;
42+
add_header Cache-Control "public";
43+
}
44+
45+
# Health check endpoint
46+
location /health {
47+
access_log off;
48+
return 200 "healthy\n";
49+
add_header Content-Type text/plain;
50+
}
51+
}

0 commit comments

Comments
 (0)