Skip to content

Commit cdefd9f

Browse files
authored
Merge pull request #13 from Nyamort/master
Dockerize the application
2 parents 4dc130f + 0935ed1 commit cdefd9f

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM oven/bun:alpine AS builder
2+
WORKDIR /app
3+
4+
COPY ./package.json ./bun.lock ./
5+
RUN bun install --frozen-lockfile
6+
7+
COPY . .
8+
RUN bun run build
9+
10+
FROM oven/bun:alpine AS runner
11+
WORKDIR /app
12+
13+
COPY ./package.json ./bun.lock ./
14+
RUN bun install --frozen-lockfile --production --ignore-scripts --no-cache
15+
16+
COPY --from=builder /app/dist ./dist
17+
18+
EXPOSE 4141
19+
20+
CMD ["bun", "run", "dist/main.js"]

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,20 @@ To install dependencies, run:
2424
bun install
2525
```
2626

27+
## Using with docker
28+
29+
Build image
30+
31+
```sh
32+
docker build -t copilot-api .
33+
```
34+
35+
Run the container
36+
37+
```sh
38+
docker run -p 4141:4141 copilot-api
39+
```
40+
2741
## Using with npx
2842

2943
You can run the project directly using npx:

0 commit comments

Comments
 (0)