Compare commits

...

3 Commits

Author SHA1 Message Date
shihaam 42bca3d114 fix hardcoded domain url to by current domain
Build and deploy / Build and Push Docker Images (push) Successful in 3m44s
2025-12-13 16:34:52 +05:00
shihaam cf0a39c43b update docs 2025-12-13 16:04:04 +05:00
shihaam 06346b5fcd increase upload to 8MB 2025-12-13 16:03:25 +05:00
6 changed files with 46 additions and 4 deletions
+1
View File
@@ -4,6 +4,7 @@ server {
server_name _;
access_log /dev/stdout;
error_log /dev/stdout info;
client_max_body_size 8M;
location /api/ {
proxy_pass http://python:8000/api/;
+1
View File
@@ -4,6 +4,7 @@ server {
server_name _;
access_log /dev/stdout;
error_log /dev/stdout info;
client_max_body_size 8M;
location /api/ {
proxy_pass http://mapmaker:8000/api/;
+38
View File
@@ -2,3 +2,41 @@
## run migrations
docker compose exec python alembic upgrade head
```yaml
services:
app:
hostname: mapmaker
image: git.shihaam.dev/sarlink/mapmaker/api
env_file: .env
volumes:
- ./storage/images:/var/www/html/storage/images
depends_on:
- postgres
nginx:
hostname: mapmaker-nginx
image: git.shihaam.dev/sarlink/mapmaker/nginx
volumes_from:
- app
ports:
- 8000:80
depends_on:
- app
postgres:
image: postgis/postgis:15-3.3
hostname: database
restart: always
environment:
POSTGRES_USER: mapmaker
POSTGRES_PASSWORD: mapmaker
POSTGRES_DB: mapmaker
volumes:
- ./storage/database:/var/lib/postgresql/data
# ports:
# - "5432:5432"
```
## prod docker compose.yml
+2 -2
View File
@@ -51,9 +51,9 @@ export function useMapWebSocket({
// Get the token for authenticated users
const token = authService.getAccessToken();
// Build WebSocket URL
// Build WebSocket URL - always use current domain
const wsProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsHost = import.meta.env.VITE_API_URL?.replace(/^https?:\/\//, '') || window.location.host;
const wsHost = window.location.host;
let wsUrl = `${wsProtocol}//${wsHost}/ws/maps/${mapId}`;
// Add authentication
+2 -1
View File
@@ -1,6 +1,7 @@
import axios from 'axios';
const API_URL = import.meta.env.VITE_API_URL || 'http://localhost:8000';
// Always use current domain - nginx proxies /api to backend
const API_URL = window.location.origin;
export const apiClient = axios.create({
baseURL: API_URL,
+2 -1
View File
@@ -25,7 +25,8 @@ class UploadService {
}
getImageUrl(path: string): string {
const apiUrl = import.meta.env.VITE_API_URL || 'http://localhost:8000';
// Always use current domain
const apiUrl = window.location.origin;
// If it's a path like /api/uploads/image/xxx.jpg
if (path.startsWith('/api/uploads/image/')) {