24 lines
516 B
Docker
24 lines
516 B
Docker
FROM oven/bun:1 AS base
|
|
WORKDIR /usr/src/app
|
|
|
|
FROM base AS install
|
|
RUN mkdir -p /tmp/dev
|
|
COPY package.json bun.lockb /tmp/dev
|
|
RUN cd /tmp/dev && bun install --frozen-lockfile
|
|
|
|
RUN mkdir -p /tmp/prod
|
|
COPY package.json bun.lockb /tmp/prod
|
|
RUN cd /tmp/prod && bun install --frozen-lockfile --production
|
|
|
|
FROM base AS release
|
|
COPY --from=install /tmp/dev/node_modules node_modules
|
|
COPY . .
|
|
|
|
ENV NODE_ENV=production
|
|
RUN bun test
|
|
RUN bun run build
|
|
|
|
USER bun
|
|
EXPOSE 3000/tcp
|
|
ENTRYPOINT [ "bun", "--bun", "run", "./build" ]
|