-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (24 loc) · 871 Bytes
/
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
FROM node:lts-bullseye-slim AS pnpm
ARG PNPM_VERSION=7.18.2
RUN corepack enable && corepack prepare pnpm@${PNPM_VERSION} --activate
FROM pnpm AS builder
WORKDIR /usr/app
COPY pnpm-lock.yaml ./
RUN --mount=type=cache,id=pnpm-store,target=/root/.pnpm-store\
pnpm fetch
COPY . ./
RUN --mount=type=cache,id=pnpm-store,target=/root/.pnpm-store \
pnpm install --frozen-lockfile
RUN pnpm run build
RUN pnpm prune --prod
FROM tailscale/tailscale:stable
ENV NODE_ENV production
WORKDIR /usr/app
RUN apk update && apk add -U dumb-init nodejs openvpn
RUN apk add --no-cache ca-certificates iptables iproute2 ip6tables
COPY package.json ./
COPY --from=builder /usr/app/dist ./
COPY --from=builder /usr/app/node_modules ./node_modules
COPY --from=builder /usr/app/scripts/entrypoint.sh /usr/bin/entrypoint.sh
RUN chmod +x /usr/bin/entrypoint.sh
CMD ["entrypoint.sh"]