diff --git a/.dockerignore b/.dockerignore index dadddee..ecd3bb7 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,6 @@ +# CI workflows +.github/ + # flyctl launch added from .gitignore # Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore diff --git a/Dockerfile b/Dockerfile index a1c3f62..427f580 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ -FROM oven/bun AS build +FROM docker.io/oven/bun:1-alpine AS builder + +RUN apk add python3 build-base WORKDIR /app @@ -9,14 +11,17 @@ RUN bun install --frozen-lockfile COPY src ./src -RUN bun build ./src/index.ts --compile --outfile bot +RUN bun build --compile --sourcemap --outfile bot ./src/index.ts + +FROM docker.io/alpine:3 -FROM ubuntu:22.04 +# For some reason, Bun single-file executables targeting musl require libstdc++ +RUN apk --no-cache add libstdc++ WORKDIR /app -COPY --from=build /app/bot /app/bot +COPY --from=builder /app/bot /app/bot ENV TZ=America/Indiana/Indianapolis -CMD ["/app/bot"] +ENTRYPOINT ["/app/bot"]