feat: unify on single repo-root compose file for dev and prod
This commit is contained in:
parent
9acdbaa453
commit
af993bd43f
18 changed files with 253 additions and 229 deletions
|
|
@ -1,13 +1,15 @@
|
|||
import { defineConfig } from "vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
|
||||
// Both dev server and preview proxy /api to the backend service.
|
||||
// `api` is the compose service name, identical in dev and prod.
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
server: {
|
||||
port: 3000,
|
||||
proxy: {
|
||||
"/api": {
|
||||
target: "http://localhost:8000",
|
||||
target: "http://api:8000",
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
|
|
@ -16,8 +18,7 @@ export default defineConfig({
|
|||
port: 3000,
|
||||
proxy: {
|
||||
"/api": {
|
||||
// Overridable at container start (prod compose: http://app:8000).
|
||||
target: process.env.VITE_API_PROXY_TARGET ?? "http://localhost:8000",
|
||||
target: "http://api:8000",
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue