diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md index 6f814a4..022d27f 100644 --- a/DEPLOYMENT.md +++ b/DEPLOYMENT.md @@ -98,7 +98,7 @@ server { server_name api.yourdomain.com; location / { - proxy_pass http://localhost:3000; + proxy_pass http://localhost:4395; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -142,7 +142,7 @@ RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/ WORKDIR /app COPY --from=rust-builder /app/target/release/api_server ./ COPY --from=web-builder /app/dist ./static -EXPOSE 3000 +EXPOSE 4395 CMD ["./api_server"] ``` @@ -150,14 +150,14 @@ Build and run: ```bash docker build -t orbital-simulator . -docker run -p 3000:3000 orbital-simulator +docker run -p 4395:4395 orbital-simulator ``` ## Configuration ### Environment Variables -- `PORT`: Server port (default: 3000) +- `PORT`: Server port (default: 4395) - `HOST`: Server host (default: 0.0.0.0) - `STATIC_DIR`: Directory for static files (default: web/dist) - `LOG_LEVEL`: Logging level (debug, info, warn, error) diff --git a/Dockerfile b/Dockerfile index 556ee08..442c852 100644 --- a/Dockerfile +++ b/Dockerfile @@ -98,11 +98,11 @@ RUN mkdir -p logs && \ USER appuser # Expose port -EXPOSE 3000 +EXPOSE 4395 # Health check HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ - CMD curl -f http://localhost:3000/api/configs || exit 1 + CMD curl -f http://localhost:4395/api/configs || exit 1 # Start the application CMD ["./api_server"] diff --git a/docker-compose.yml b/docker-compose.yml index e093a35..73f7c63 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,37 +6,20 @@ services: context: . dockerfile: Dockerfile ports: - - "3000:3000" + - "4395:4395" environment: - RUST_LOG=info - - BIND_ADDRESS=0.0.0.0:3000 + - BIND_ADDRESS=0.0.0.0:4395 volumes: # Optional: Mount config directory for easy config updates - ./config:/app/config:ro # Optional: Mount logs directory - - orbital_logs:/app/logs + - ./orbital_logs:/app/logs restart: unless-stopped healthcheck: - test: ["CMD-SHELL", "curl -f http://localhost:3000/api/configs || exit 1"] + test: ["CMD-SHELL", "curl -f http://localhost:4395/api/configs || exit 1"] interval: 30s timeout: 10s retries: 3 start_period: 40s - # Optional: Add a reverse proxy for production - nginx: - image: nginx:alpine - ports: - - "80:80" - - "443:443" - volumes: - - ./nginx.conf:/etc/nginx/nginx.conf:ro - - ./ssl:/etc/nginx/ssl:ro - depends_on: - - orbital-simulator - restart: unless-stopped - profiles: - - production - -volumes: - orbital_logs: diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index aa1515e..63a1096 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -43,7 +43,7 @@ async fn start_api_server() -> Result { cmd.args(&["run", "--release", "--bin", "api_server"]); match cmd.spawn() { - Ok(_) => Ok("API server started on http://localhost:3000".to_string()), + Ok(_) => Ok("API server started on http://localhost:4395".to_string()), Err(e) => Err(format!("Failed to start API server: {}", e)), } } diff --git a/src/bin/api_server.rs b/src/bin/api_server.rs index 223d709..11f9588 100644 --- a/src/bin/api_server.rs +++ b/src/bin/api_server.rs @@ -513,8 +513,8 @@ pub async fn main() { // Serve static files for the web frontend let app = app.nest_service("/", ServeDir::new("web/dist")); - println!("🚀 Orbital Simulator API Server starting on http://localhost:3000"); + println!("🚀 Orbital Simulator API Server starting on http://localhost:4395"); - let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap(); + let listener = tokio::net::TcpListener::bind("0.0.0.0:4395").await.unwrap(); axum::serve(listener, app).await.unwrap(); } diff --git a/web/vite.config.ts b/web/vite.config.ts index 36964fa..0fc9652 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -7,7 +7,7 @@ export default defineConfig({ port: 5173, proxy: { '/api': { - target: 'http://localhost:3000', + target: 'http://localhost:4395', changeOrigin: true, } }