| FROM node:18-alpine |
|
|
| WORKDIR /app |
|
|
| |
| COPY . . |
|
|
| |
| RUN npm config set registry https://registry.npmjs.org/ |
| RUN npm config set fetch-retry-maxtimeout 60000 |
| RUN npm config set fetch-retry-mintimeout 10000 |
| RUN npm config set fetch-retries 5 |
|
|
| |
| RUN npm install || npm install --legacy-peer-deps || npm install --no-fund --no-audit |
|
|
| |
| RUN npm run build |
|
|
| |
| RUN npm install -g serve && apk add --no-cache curl |
|
|
| |
| ENV PORT=7860 |
|
|
| |
| EXPOSE 7860 |
| EXPOSE 3000 |
|
|
| |
| HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \ |
| CMD curl -f http://localhost:${PORT}/ || exit 1 |
|
|
| |
| RUN chmod +x start.sh |
|
|
| |
| CMD ["/bin/sh", "./start.sh"] |