Skip to content

Commit

Permalink
update nginx and docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
saroar committed Mar 24, 2024
1 parent a57ac9f commit 76af4f3
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 5 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
# AddameServer



4. Check for Configuration File Inside the Container
You can also directly check the contents of the /etc/nginx/conf.d directory
inside the container to ensure your configuration file is present:


docker exec addame_nginx_rp ls /etc/nginx/conf.d

And to inspect the contents of your configuration file (replace default.conf with your file name if different):

docker exec addame_nginx_rp cat /etc/nginx/conf.d/default.conf

If the configuration file is correctly placed and Nginx still doesn't seem to behave as expected,
review the configuration file for syntax errors or misconfigurations.
You can use nginx -t inside the container to test the Nginx configuration for syntax correctness:


docker exec addame_nginx_rp nginx -t
21 changes: 16 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,14 @@ services:

addame_server:
image: addamespb/addame_server:latest
container_name: addameServer
container_name: addame_server
build:
context: addameServer
environment:
<<: *shared_environment
ports:
- '80:8080'
- '443:8080'
- '8080:8080'
command: ["serve", "--env", "production", "--hostname", "0.0.0.0", "--port", "8080"]
- '8010:8010'
command: ["serve", "--env", "production", "--hostname", "0.0.0.0", "--port", "8010"]
volumes:
- ~/addameServer:/addameServer_data
- ./.env:/app/.env
Expand All @@ -59,6 +57,19 @@ services:
env_file:
- ./.env

addame_nginx:
image: nginx:latest
container_name: addame_nginx_rp
ports:
- '80:80'
- '443:443'
volumes:
- ./nginx:/etc/nginx/conf.d:ro
depends_on:
- addame_server
networks:
- addame_pro_gateway

volumes:
addameServer:
redis-persistence-production:
Expand Down
13 changes: 13 additions & 0 deletions nginx/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

server {
listen 80;
server_name addame.com;

location / {
proxy_pass http://addame_server:8010; # Adjusted to match your service name and internal port
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 76af4f3

Please sign in to comment.