sc/full-world-wrap #6
+4
-3
@@ -20,8 +20,9 @@ services:
|
|||||||
context: ./backend
|
context: ./backend
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
container_name: line-of-sight-backend
|
container_name: line-of-sight-backend
|
||||||
ports:
|
# Removed public port exposure for security; accessible via frontend proxy
|
||||||
- "3051:3051"
|
# ports:
|
||||||
|
# - "3051:3051"
|
||||||
environment:
|
environment:
|
||||||
- DATABASE_URL=postgresql://line_of_sight:line_of_sight_pass@postgres:5432/line_of_sight
|
- DATABASE_URL=postgresql://line_of_sight:line_of_sight_pass@postgres:5432/line_of_sight
|
||||||
- PORT=3051
|
- PORT=3051
|
||||||
@@ -40,7 +41,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "3050:3050"
|
- "3050:3050"
|
||||||
environment:
|
environment:
|
||||||
- VITE_API_URL=http://localhost:3051/api
|
- VITE_API_URL=/api
|
||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
- backend
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
const API_BASE_URL = import.meta.env.VITE_API_URL || 'http://localhost:3051/api';
|
const API_BASE_URL = import.meta.env.VITE_API_URL || '/api';
|
||||||
|
|
||||||
const api = axios.create({
|
const api = axios.create({
|
||||||
baseURL: API_BASE_URL,
|
baseURL: API_BASE_URL,
|
||||||
|
|||||||
@@ -12,7 +12,13 @@ export default defineConfig({
|
|||||||
server: {
|
server: {
|
||||||
port: 3050,
|
port: 3050,
|
||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
allowedHosts: true
|
allowedHosts: true,
|
||||||
|
proxy: {
|
||||||
|
'/api': {
|
||||||
|
target: 'http://backend:3051',
|
||||||
|
changeOrigin: true
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
outDir: 'build',
|
outDir: 'build',
|
||||||
|
|||||||
Reference in New Issue
Block a user