Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Add Dockerfile #27

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
ARG BUN_VERSION="1.1.38"

# --- Build container ---
FROM oven/bun:${BUN_VERSION}-slim AS build

ARG REVISION="master"

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
&& apt-get install -y build-essential git python3

RUN mkdir /app \
&& cd /app \
&& git clone https://github.com/LadybirdBrowser/discord-bot.git \
&& cd discord-bot \
&& git checkout "${REVISION}" \
&& rm -rf .git \
&& bun install

# --- Runtime image ---
FROM oven/bun:${BUN_VERSION}-slim

LABEL maintainer="Ladybird Browser Initiative <[email protected]>"

RUN mkdir /app
COPY --from=build /app/discord-bot /app/discord-bot

RUN useradd discord-bot \
&& chown -R discord-bot:discord-bot /app/discord-bot

USER discord-bot
WORKDIR /app/discord-bot

ENTRYPOINT [ "/usr/local/bin/bun" ]
CMD [ "start" ]
Loading