Changed docker config to avvoir connection error between client and server

main
oabrivard 1 week ago
parent 6b169679fe
commit cdfe76be2a

@ -2,3 +2,4 @@ DATABASE_URL=sqlite:knowfoolery.db?mode=rwc
PORT=3000
JWT_SECRET=change-me-to-a-random-secret
RUST_LOG=knowfoolery_server=debug,tower_http=debug
VITE_BACKEND_URL=http://backend:3000

@ -19,6 +19,8 @@ services:
dockerfile: Dockerfile.frontend
ports:
- "5173:5173"
environment:
VITE_BACKEND_URL: "http://backend:3000"
depends_on:
- backend

@ -1,17 +1,19 @@
import { defineConfig } from "vite";
import solidPlugin from "vite-plugin-solid";
const backendTarget = process.env.VITE_BACKEND_URL ?? "http://localhost:3000";
export default defineConfig({
plugins: [solidPlugin()],
server: {
port: 5173,
proxy: {
"/api": {
target: "http://localhost:3000",
target: backendTarget,
changeOrigin: true,
},
"/health": {
target: "http://localhost:3000",
target: backendTarget,
changeOrigin: true,
},
},

Loading…
Cancel
Save