fix docker maybe
This commit is contained in:
parent
52e1d6ff6b
commit
4cd56673db
@ -16,7 +16,7 @@ This guide explains how to build and deploy the SessionZero Blazor WebAssembly P
|
||||
docker-compose up -d --build
|
||||
```
|
||||
|
||||
3. Access the application at http://localhost:8080
|
||||
3. Access the application at http://localhost:80
|
||||
|
||||
## Building and Running with Docker CLI
|
||||
|
||||
@ -30,10 +30,10 @@ This guide explains how to build and deploy the SessionZero Blazor WebAssembly P
|
||||
3. Run the container:
|
||||
|
||||
```bash
|
||||
docker run -d -p 8080:80 --name sessionzero-app sessionzero
|
||||
docker run -d -p 80:80 --name sessionzero-app sessionzero
|
||||
```
|
||||
|
||||
4. Access the application at http://localhost:8080
|
||||
4. Access the application at http://localhost:80
|
||||
|
||||
## Stopping the Container
|
||||
|
||||
@ -58,7 +58,7 @@ docker rm sessionzero-app
|
||||
docker logs sessionzero-app
|
||||
```
|
||||
|
||||
- Make sure ports 8080 is not being used by another application on your host machine.
|
||||
- Make sure port 80 is not being used by another application on your host machine. Note that port 80 often requires administrative privileges on most operating systems since it's a privileged port.
|
||||
|
||||
- If the application doesn't work as expected, verify that all files were copied correctly by inspecting the container:
|
||||
|
||||
|
@ -6,10 +6,13 @@ services:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "8080:80" # Map container port 80 to host port 8080
|
||||
- "80:80" # Map container port 80 to host port 80
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- nginx-cache:/var/cache/nginx
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Production
|
||||
- ASPNETCORE_URLS=http://+:80
|
||||
|
||||
volumes:
|
||||
nginx-cache:
|
||||
|
@ -13,12 +13,15 @@ http {
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
server_name _; # Accept any server name
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html =404;
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
|
||||
}
|
||||
|
||||
# Enable compression
|
||||
|
49
run-remote.sh
Normal file
49
run-remote.sh
Normal file
@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This script helps test domain connectivity for SessionZero
|
||||
|
||||
echo "=== SessionZero Domain Connectivity Test ==="
|
||||
echo ""
|
||||
|
||||
# Check if docker is running
|
||||
if ! docker info > /dev/null 2>&1; then
|
||||
echo "Error: Docker is not running or not installed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if the container is running
|
||||
if ! docker ps | grep -q sessionzero; then
|
||||
echo "Warning: SessionZero container is not running."
|
||||
echo "Starting container..."
|
||||
docker-compose up -d
|
||||
fi
|
||||
|
||||
# Get the domain from user input
|
||||
read -p "Enter your domain (without http/https): " DOMAIN
|
||||
|
||||
echo ""
|
||||
echo "Testing connectivity to $DOMAIN..."
|
||||
|
||||
# Test basic HTTP connectivity
|
||||
echo "HTTP connectivity test:"
|
||||
curl -v http://$DOMAIN/ -o /dev/null 2>&1 | grep -E 'Connected|< HTTP'
|
||||
|
||||
# Check DNS resolution
|
||||
echo ""
|
||||
echo "DNS resolution test:"
|
||||
host $DOMAIN
|
||||
|
||||
# Check if port 80 is open
|
||||
echo ""
|
||||
echo "Port 80 test:"
|
||||
nc -zv $DOMAIN 80 2>&1
|
||||
|
||||
# Get server's public IP
|
||||
echo ""
|
||||
echo "Your server's public IP:"
|
||||
curl -s ifconfig.me
|
||||
|
||||
echo ""
|
||||
echo "=== Test Complete ==="
|
||||
echo "If all tests passed but the site still doesn't work, check your Nginx logs:"
|
||||
echo "docker logs sessionzero-app"
|
Loading…
Reference in New Issue
Block a user