chore(deploy): 本地部署脚本、容器配置与运行说明
PostgreSQL/pgvector 与 Redis 独立容器,后端、worker、前端可一键启停;不覆盖既有密钥。
This commit is contained in:
1 parent
83a16ed07d
commit
5be5ca3376
18 files changed
+1796
No files matched your search
@@ -0,0 +1,46 @@
|
||||
FROM node:20-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
wget \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
|
||||
# Copy package files first
|
||||
COPY frontend/package*.json ./
|
||||
|
||||
|
||||
|
||||
|
||||
# Copy frontend source code
|
||||
COPY frontend/ .
|
||||
|
||||
RUN npm install
|
||||
|
||||
# Create startup script in /usr/local/bin
|
||||
RUN echo '#!/bin/bash\n\
|
||||
echo "Waiting for backend..."\n\
|
||||
until curl -f http://backend:8000/health; do\n\
|
||||
echo "Backend not ready - sleeping"\n\
|
||||
sleep 5\n\
|
||||
done\n\
|
||||
\n\
|
||||
echo "Backend is ready - building widget and webclient"\n\
|
||||
cd /app && npm run build:widgetdocker\n\
|
||||
cd /app && npm run build:webclient\n\
|
||||
\n\
|
||||
echo "Starting frontend development server"\n\
|
||||
cd /app && npm run dev -- --host 0.0.0.0 --port 3000' > /usr/local/bin/start.sh
|
||||
|
||||
# Make startup script executable
|
||||
RUN chmod +x /usr/local/bin/start.sh
|
||||
|
||||
# Expose port
|
||||
EXPOSE 3000
|
||||
|
||||
# Start the application in development mode
|
||||
CMD ["/bin/bash", "/usr/local/bin/start.sh"]
|
||||
Reference in new issue
Block a user