fixing docker-compose
This commit is contained in:
@@ -97,11 +97,11 @@ RUN echo '{"status":"ok","service":"web-app"}' > /usr/share/nginx/html/health
|
||||
USER nginx-user
|
||||
|
||||
# Expose port
|
||||
EXPOSE 3000
|
||||
EXPOSE 4000
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD curl --fail http://localhost:3000/health || exit 1
|
||||
CMD curl --fail http://localhost:4000/health || exit 1
|
||||
|
||||
# Start nginx
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
user nginx-user;
|
||||
# Running as non-root user defined by container user; omit nginx "user" directive
|
||||
worker_processes auto;
|
||||
error_log /var/log/nginx/error.log notice;
|
||||
pid /tmp/nginx.pid;
|
||||
@@ -27,7 +27,7 @@ http {
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_min_length 10240;
|
||||
gzip_proxied expired no-cache no-store private must-revalidate auth;
|
||||
gzip_proxied expired no-cache no-store private auth;
|
||||
gzip_types
|
||||
text/plain
|
||||
text/css
|
||||
@@ -78,13 +78,13 @@ http {
|
||||
# Health check endpoint
|
||||
location /health {
|
||||
access_log off;
|
||||
return 200 '{"status":"ok","service":"web-app"}\n';
|
||||
add_header Content-Type application/json;
|
||||
return 200 '{"status":"ok","service":"web-app"}\n';
|
||||
}
|
||||
|
||||
# API proxy (if needed for backend communication)
|
||||
location /api/ {
|
||||
proxy_pass http://api-gateway:8081/;
|
||||
proxy_pass http://localhost:8081/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
Reference in New Issue
Block a user