-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (33 loc) · 1.32 KB
/
Dockerfile
File metadata and controls
42 lines (33 loc) · 1.32 KB
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
FROM mwader/static-ffmpeg:8.0.1 AS ffmpeg
FROM node:24-alpine AS build
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
ARG GIT_TAG
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.11.2-1+b1 build-essential=12.9 \
# && apt-get clean \
# && rm -rf /var/lib/apt/lists/*
COPY packages/ ./packages/
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml LICENSE ./
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
pnpm install --frozen-lockfile
RUN pnpm run build:bot \
&& pnpm deploy --prod --filter "./packages/bot" /build
FROM gcr.io/distroless/nodejs24-debian12:nonroot
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 .
CMD ["build/index.mjs"]