| |
| |
| |
| FROM node:20-slim |
|
|
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| ca-certificates openssl \ |
| && update-ca-certificates \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| RUN useradd -m -u 1000 appuser 2>/dev/null || true |
|
|
| WORKDIR /app |
| COPY package.json ./ |
| RUN npm install --production --no-audit --no-fund && npm cache clean --force |
| COPY index.js strings.html ./ |
|
|
| |
| ENV NODE_OPTIONS="--max-old-space-size=8192 --expose-gc --openssl-legacy-provider" |
|
|
| EXPOSE 7860 |
| USER 1000 |
|
|
| 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)});" |
|
|
| CMD ["node", "index.js"] |