always build using bun
This commit is contained in:
parent
45dfe1a1c7
commit
25c825be38
2 changed files with 16 additions and 18 deletions
32
Dockerfile
32
Dockerfile
|
@ -1,35 +1,33 @@
|
|||
FROM node:20-alpine AS builder
|
||||
|
||||
RUN mkdir -p /data && chown node:node /data
|
||||
FROM oven/bun:alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json .
|
||||
RUN npm install
|
||||
RUN apk add git
|
||||
|
||||
COPY package.json ./
|
||||
RUN bun install
|
||||
COPY . .
|
||||
|
||||
RUN npm run build
|
||||
RUN mkdir -p /data \
|
||||
&& touch /data/portal-btc.db \
|
||||
&& chown -R bun:bun /app /data
|
||||
|
||||
FROM node:20-alpine
|
||||
RUN bun run build
|
||||
|
||||
FROM oven/bun:alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
||||
|
||||
COPY package.json .
|
||||
RUN npm install --omit=dev
|
||||
|
||||
RUN mkdir -p /data
|
||||
RUN touch /data/portal-btc.db
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY --from=builder /app/package.json ./package.json
|
||||
COPY --from=builder /app/bun.lock ./bun.lock
|
||||
|
||||
COPY --from=builder /app/build .
|
||||
|
||||
VOLUME /data
|
||||
RUN chown -R appuser:appgroup /app /data
|
||||
|
||||
USER appuser
|
||||
USER bun
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["node", "index.js"]
|
||||
CMD ["bun", "index.js"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue