Skip to content

Commit b4794a3

Browse files
committed
build: use Alpine as base image
1 parent 405ea59 commit b4794a3

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# CI workflows
2+
.github/
3+
14
# flyctl launch added from .gitignore
25
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
36

Dockerfile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
FROM oven/bun AS build
1+
FROM docker.io/oven/bun:1-alpine AS builder
2+
3+
RUN apk add python3
24

35
WORKDIR /app
46

@@ -9,14 +11,17 @@ RUN bun install --frozen-lockfile
911

1012
COPY src ./src
1113

12-
RUN bun build ./src/index.ts --compile --outfile bot
14+
RUN bun build --compile --minify --sourcemap --bytecode --outfile bot ./src/index.ts
15+
16+
FROM docker.io/alpine:3
1317

14-
FROM ubuntu:22.04
18+
# For some reason, Bun single-file executables targeting musl require libstdc++
19+
RUN apk --no-cache add libstdc++
1520

1621
WORKDIR /app
1722

18-
COPY --from=build /app/bot /app/bot
23+
COPY --from=builder /app/bot /app/bot
1924

2025
ENV TZ=America/Indiana/Indianapolis
2126

22-
CMD ["/app/bot"]
27+
ENTRYPOINT ["/app/bot"]

0 commit comments

Comments
 (0)