-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (16 loc) · 722 Bytes
/
Copy pathDockerfile
File metadata and controls
25 lines (16 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
FROM oven/bun:1.3.8-alpine
WORKDIR /app
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile --production
COPY --chown=bun:bun src ./src
COPY --chown=bun:bun tsconfig.json ./tsconfig.json
COPY --chown=bun:bun README.md ./README.md
ENV NODE_ENV=production
ENV HTTP_PORT=3100
ENV STATE_FILE_PATH=/app/data/issuecommand-state.json
VOLUME ["/app/data"]
EXPOSE 3100
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
CMD bun -e "const p=process.env.HTTP_PORT||3100;const k=process.env.API_KEY||'';fetch('http://127.0.0.1:'+p+'/api/health',{headers:{Authorization:'Bearer '+k}}).then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1));"
USER bun
CMD ["bun", "run", "src/index.ts"]