20 lines
451 B
Docker
20 lines
451 B
Docker
|
FROM oven/bun:1 as base
|
||
|
WORKDIR /usr/src/app
|
||
|
|
||
|
FROM base AS install
|
||
|
RUN mkdir -p /temp/dev
|
||
|
COPY package.json bun.lockb /temp/dev/
|
||
|
RUN cd /temp/dev && bun install --frozen-lockfile
|
||
|
|
||
|
FROM base AS release
|
||
|
COPY --from=install /temp/dev/node_modules node_modules
|
||
|
COPY --from=install /temp/dev/package.json .
|
||
|
COPY ./src ./src
|
||
|
COPY ./tests ./tests
|
||
|
|
||
|
USER bun
|
||
|
ENV NODE_ENV dev
|
||
|
EXPOSE 8080/tcp
|
||
|
ENTRYPOINT [ "/bin/bash", "-c" ]
|
||
|
CMD ["bun --hot run src/index.ts"]
|