| |
| FROM node:20-slim |
|
|
| |
| WORKDIR /app |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| python3 \ |
| git \ |
| make \ |
| g++ \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| COPY package*.json ./ |
| RUN npm install |
|
|
| |
| COPY server.js ./ |
|
|
| |
| COPY frontend ./frontend |
|
|
| |
| WORKDIR /app/frontend |
| RUN npm install && npm run build |
|
|
| |
| WORKDIR /app |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \ |
| CMD node -e "require('http').get('http://localhost:7860/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})" |
|
|
| RUN chmod -R 777 /app |
|
|
| |
| CMD ["npm", "start"] |