| |
| FROM node:20-slim AS frontend-builder |
| WORKDIR /app/frontend |
| COPY frontend/package*.json ./ |
| RUN npm install |
| COPY frontend/ ./ |
| ENV VITE_API_URL=/api |
| RUN npm run build |
|
|
| |
| FROM node:20-slim |
|
|
| |
| |
| RUN apt-get update && apt-get install -y \ |
| curl \ |
| nginx \ |
| python3 \ |
| python3-pip \ |
| python3-dev \ |
| build-essential \ |
| wget \ |
| gnupg \ |
| ca-certificates \ |
| procps \ |
| libasound2 \ |
| libatk-bridge2.0-0 \ |
| libatk1.0-0 \ |
| libc6 \ |
| libcairo2 \ |
| libcups2 \ |
| libdbus-1-3 \ |
| libexpat1 \ |
| libfontconfig1 \ |
| libgbm1 \ |
| libglib2.0-0 \ |
| libgtk-3-0 \ |
| libnspr4 \ |
| libnss3 \ |
| libpango-1.0-0 \ |
| libpangocairo-1.0-0 \ |
| libstdc++6 \ |
| libx11-6 \ |
| libx11-xcb1 \ |
| libxcb1 \ |
| libxcomposite1 \ |
| libxcursor1 \ |
| libxdamage1 \ |
| libxext6 \ |
| libxfixes3 \ |
| libxi6 \ |
| libxrandr2 \ |
| libxrender1 \ |
| libxtst6 \ |
| fonts-liberation \ |
| lsb-release \ |
| xdg-utils \ |
| ffmpeg \ |
| --no-install-recommends \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| WORKDIR /app |
|
|
| |
| COPY backend/package*.json ./backend/ |
| RUN cd backend && npm install |
|
|
| |
| |
| COPY requirements.txt ./ |
| RUN sed -i '/-r/d' requirements.txt && \ |
| pip3 install --no-cache-dir --break-system-packages -r requirements.txt |
|
|
| |
| COPY . . |
|
|
| |
| COPY --from=frontend-builder /app/frontend/dist ./frontend/dist |
|
|
| |
| COPY nginx.conf /etc/nginx/nginx.conf |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| RUN chmod +x /app/start.sh |
|
|
| |
| CMD ["/app/start.sh"] |
|
|