We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 899ee48 commit e1a01beCopy full SHA for e1a01be
2 files changed
Dockerfile
@@ -38,6 +38,10 @@ COPY --from=builder /app/dist/ /usr/share/nginx/html/
38
# Copy custom nginx configuration
39
COPY nginx.conf /etc/nginx/nginx.conf
40
41
+# Add entripoint script
42
+COPY start.sh /start.sh
43
+RUN sed -i 's/\r$//' /start.sh && chmod +x /start.sh
44
+
45
EXPOSE 5173
46
-CMD ["nginx", "-g", "daemon off;"]
47
+CMD ["/start.sh"]
start.sh
@@ -0,0 +1,12 @@
1
+#!/bin/sh
2
+set -e
3
4
+echo "Injecting API key into bundle..."
5
6
+# Find all JS files and replace the placeholder with the real key
7
+find /usr/share/nginx/html/assets -name "*.js" | while read file; do
8
+ sed -i "s|__GEMINI_API_KEY_PLACEHOLDER__|${GEMINI_API_KEY}|g" "$file"
9
+done
10
11
+echo "Starting nginx..."
12
+exec nginx -g "daemon off;"
0 commit comments