Skip to content

Commit

Permalink
Update: Added K8s & Jenkins CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangsonww committed Oct 23, 2024
1 parent f3027ff commit a0a6252
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
Empty file added identifier.sqlite
Empty file.
14 changes: 14 additions & 0 deletions nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Base image for nginx
FROM nginx:latest

# Remove the default nginx config file
RUN rm /etc/nginx/conf.d/default.conf

# Copy the custom nginx configuration file
COPY nginx.conf /etc/nginx/conf.d/

# Expose port 80
EXPOSE 80

# Start Nginx
CMD ["nginx", "-g", "daemon off;"]
25 changes: 25 additions & 0 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Load Balancer Configuration
http {
upstream django_backend {
server moodify-emotion-music-app.onrender.com; # Default port: 10000
server moodify-emotion-music-app.onrender.com:8000;
server moodify-emotion-music-app.onrender.com:8001;
server moodify-emotion-music-app.onrender.com:8002;
}

# Server block for load balancing
server {
listen 80;

# Define the root for the requests, forward to upstream
location / {
proxy_pass http://django_backend;

# Set proxy headers
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
}

0 comments on commit a0a6252

Please sign in to comment.