Skip to content

Commit 99059a1

Browse files
committed
CI: Add Dockerfile
This is used as the runtime image for the Discord bot.
1 parent 7c1cbfc commit 99059a1

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

Dockerfile

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
ARG BUN_VERSION="1.1.38"
2+
3+
# --- Build container ---
4+
FROM oven/bun:${BUN_VERSION}-slim AS build
5+
6+
ARG REVISION="master"
7+
8+
ENV DEBIAN_FRONTEND=noninteractive
9+
10+
RUN apt-get update \
11+
&& apt-get install -y build-essential git python3
12+
13+
RUN mkdir /app \
14+
&& cd /app \
15+
&& git clone https://github.com/LadybirdBrowser/discord-bot.git \
16+
&& cd discord-bot \
17+
&& git checkout "${REVISION}" \
18+
&& rm -rf .git \
19+
&& bun install
20+
21+
# --- Runtime image ---
22+
FROM oven/bun:${BUN_VERSION}-slim
23+
24+
LABEL maintainer="Ladybird Browser Initiative <[email protected]>"
25+
26+
RUN mkdir /app
27+
COPY --from=build /app/discord-bot /app/discord-bot
28+
29+
RUN useradd discord-bot \
30+
&& chown -R discord-bot:discord-bot /app/discord-bot
31+
32+
USER discord-bot
33+
WORKDIR /app/discord-bot
34+
35+
ENTRYPOINT [ "/usr/local/bin/bun" ]
36+
CMD [ "start" ]

0 commit comments

Comments
 (0)