Skip to content

Commit

Permalink
feat: nginx config
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefanie-A committed Oct 28, 2024
1 parent c82774e commit e6928c2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ jobs:
cd app/python-uri-shortener
echo "Welcome!"
git pull origin main
docker pull nginx:latest
sudo systemctl start nginx
docker login -u stefnie -p ${{ secrets.docker_hub_token }}
docker pull stefnie/api-image:latest
docker pull stefnie/api-image:latest
sudo nginx -t
docker-compose -f compose.yaml up -d
9 changes: 8 additions & 1 deletion compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,11 @@ services:
container_name: build2
network_mode: "host"
volumes:
- ./app/api.py:/app/api.py
- ./app/api.py:/app/api.py

nginx:
image: nginx:latest
container_name: nginx
network_mode: "host"
volumes:
- ./nginx/conf.d/default.conf:/etc/nginx/sites-available/default
10 changes: 10 additions & 0 deletions nginx/conf.d/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
server {
listen 80;
server_name 52.23.155.226;
location / {
proxy_pass http://backend:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}

0 comments on commit e6928c2

Please sign in to comment.