removed sh script
This commit is contained in:
@@ -42,7 +42,6 @@ services:
|
|||||||
build: ./frontend
|
build: ./frontend
|
||||||
environment:
|
environment:
|
||||||
BACKEND_HOST: ${BACKEND_HOST}
|
BACKEND_HOST: ${BACKEND_HOST}
|
||||||
VITE_BACKEND_URL: /backend
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
- backend
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|||||||
@@ -13,9 +13,6 @@ FROM nginx:alpine AS runner
|
|||||||
WORKDIR /usr/share/nginx/html
|
WORKDIR /usr/share/nginx/html
|
||||||
COPY --from=builder /app/dist .
|
COPY --from=builder /app/dist .
|
||||||
|
|
||||||
COPY docker-entrypoint.d/10-runtime-env.sh /docker-entrypoint.d/10-runtime-env.sh
|
|
||||||
RUN chmod +x /docker-entrypoint.d/10-runtime-env.sh
|
|
||||||
|
|
||||||
COPY nginx.conf /etc/nginx/templates/default.conf.template
|
COPY nginx.conf /etc/nginx/templates/default.conf.template
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
VITE_BACKEND_URL_VALUE="${VITE_BACKEND_URL:-/backend}"
|
|
||||||
|
|
||||||
cat > /usr/share/nginx/html/env.js <<EOF
|
|
||||||
window.__ENV = {
|
|
||||||
VITE_BACKEND_URL: "${VITE_BACKEND_URL_VALUE}"
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
@@ -8,7 +8,6 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
<script src="/env.js"></script>
|
|
||||||
<script type="module" src="/src/main.tsx"></script>
|
<script type="module" src="/src/main.tsx"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,13 +1,4 @@
|
|||||||
type WindowWithEnv = Window & {
|
|
||||||
__ENV?: {
|
|
||||||
VITE_BACKEND_URL?: string;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const runtimeEnv = (globalThis as unknown as WindowWithEnv).__ENV;
|
|
||||||
|
|
||||||
export const API_BASE =
|
export const API_BASE =
|
||||||
runtimeEnv?.VITE_BACKEND_URL ||
|
|
||||||
(import.meta as any).env?.VITE_BACKEND_URL ||
|
(import.meta as any).env?.VITE_BACKEND_URL ||
|
||||||
import.meta.env.VITE_BACKEND_URL ||
|
import.meta.env.VITE_BACKEND_URL ||
|
||||||
"http://localhost:8004";
|
"/backend";
|
||||||
|
|||||||
Reference in New Issue
Block a user