Skip to content

Commit e1a01be

Browse files
committed
26th commit
1 parent 899ee48 commit e1a01be

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ COPY --from=builder /app/dist/ /usr/share/nginx/html/
3838
# Copy custom nginx configuration
3939
COPY nginx.conf /etc/nginx/nginx.conf
4040

41+
# Add entripoint script
42+
COPY start.sh /start.sh
43+
RUN sed -i 's/\r$//' /start.sh && chmod +x /start.sh
44+
4145
EXPOSE 5173
4246

43-
CMD ["nginx", "-g", "daemon off;"]
47+
CMD ["/start.sh"]

start.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)