-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
49 lines (38 loc) · 1.48 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM mwader/static-ffmpeg:7.0.2 as ffmpeg
FROM oven/bun:1.1.42-slim as build
ARG GIT_TAG
SHELL ["/bin/bash", "-c"]
WORKDIR /src
# node-gyp requires Python and basic packages needed to compile C libs
RUN apt-get update \
&& apt-get install -y --no-install-recommends python3=3.9.2-3 build-essential=12.9 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY packages/ ./packages/
COPY package.json bun.lockb LICENSE ./
RUN --mount=type=cache,id=bun,target=/root/.bin/install/cache \
bun install --frozen-lockfile
RUN bun run build:bot
WORKDIR /build
RUN cp -r /src/{package.json,bun.lockb,node_modules} . \
&& mkdir -p ./packages/bot \
&& cp -r /src/packages/bot/{build,assets} ./packages/bot
FROM ubuntu:jammy-20240808
COPY --from=build /usr/local/include/ /usr/local/include/
COPY --from=build /usr/local/lib/ /usr/local/lib/
COPY --from=build /usr/local/bin/ /usr/local/bin/
COPY --from=ffmpeg /ffmpeg /usr/local/bin/
LABEL org.opencontainers.image.source=https://github.com/approvers/OreOreBot2
ENV NODE_ENV=production
WORKDIR /app
# Sentry に必要なパッケージ
# RUN apt-get update \
# && apt-get install -y --no-install-recommends libssl-dev=3.0.2-0ubuntu1.13 ca-certificates=20230311ubuntu0.22.04.1 \
# && apt-get clean \
# && rm -rf /var/lib/apt/lists/*
COPY --from=build /build .
COPY --from=build /build/packages ./packages
COPY --from=build /build/packages/bot ./packages/bot
WORKDIR /app/packages/bot
ENTRYPOINT ["bun", "run"]
CMD ["build/index.mjs"]