-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (50 loc) · 1.55 KB
/
Dockerfile
File metadata and controls
54 lines (50 loc) · 1.55 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
43
44
45
46
47
48
49
50
51
52
53
54
FROM ubuntu:24.04 AS ubuntu-base
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates git \
&& groupadd --system gitstunts \
&& useradd --system --gid gitstunts --create-home --shell /usr/sbin/nologin gitstunts \
&& rm -rf /var/lib/apt/lists/*
FROM node:22 AS node-runtime
FROM oven/bun:1 AS bun-runtime
FROM denoland/deno:ubuntu-2.7.1 AS deno-runtime
# --- Node ---
FROM ubuntu-base AS node
COPY --from=node-runtime /usr/local/ /usr/local/
RUN npm install -g pnpm@10
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
COPY . .
RUN chown -R gitstunts:gitstunts /app
ENV GIT_STUNTS_DOCKER=1
ENV HOME=/home/gitstunts
USER gitstunts
CMD ["pnpm", "vitest", "run", "test/unit"]
# --- Bun ---
FROM ubuntu-base AS bun
COPY --from=bun-runtime /usr/local/bin/bun /usr/local/bin/bun
COPY --from=bun-runtime /usr/local/bin/bunx /usr/local/bin/bunx
WORKDIR /app
COPY package.json ./
RUN bun install
COPY . .
RUN chown -R gitstunts:gitstunts /app
ENV GIT_STUNTS_DOCKER=1
ENV HOME=/home/gitstunts
USER gitstunts
CMD ["bunx", "vitest", "run", "test/unit"]
# --- Deno ---
FROM ubuntu-base AS deno
COPY --from=deno-runtime /usr/bin/deno /usr/local/bin/deno
COPY --from=node-runtime /usr/local/bin/node /usr/local/bin/node
WORKDIR /app
COPY package.json ./
RUN deno install --allow-scripts || true
COPY . .
RUN deno install --allow-scripts
RUN chown -R gitstunts:gitstunts /app
ENV GIT_STUNTS_DOCKER=1
ENV HOME=/home/gitstunts
USER gitstunts
CMD ["deno", "run", "-A", "npm:vitest", "run", "test/unit"]