diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..92c7a452 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM oven/bun:alpine AS builder +WORKDIR /app + +COPY ./package.json ./bun.lock ./ +RUN bun install --frozen-lockfile + +COPY . . +RUN bun run build + +FROM oven/bun:alpine AS runner +WORKDIR /app + +COPY ./package.json ./bun.lock ./ +RUN bun install --frozen-lockfile --production --ignore-scripts --no-cache + +COPY --from=builder /app/dist ./dist + +EXPOSE 4141 + +CMD ["bun", "run", "dist/main.js"] \ No newline at end of file diff --git a/README.md b/README.md index f2ead0c7..9964f31d 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,20 @@ To install dependencies, run: bun install ``` +## Using with docker + +Build image + +```sh +docker build -t copilot-api . +``` + +Run the container + +```sh +docker run -p 4141:4141 copilot-api +``` + ## Using with npx You can run the project directly using npx: