-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (34 loc) · 1.36 KB
/
Dockerfile
File metadata and controls
37 lines (34 loc) · 1.36 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
FROM node:24.13.0-slim AS base
ARG APP_DOMAIN="sandbox.exactly.app"
ARG CHAIN_ID="11155420"
ARG EXPO_PUBLIC_DEVTOOLS
FROM base AS build
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008
RUN apt-get update && apt-get install -y ca-certificates curl git rsync unzip --no-install-recommends && \
rm -rf /var/lib/apt/lists/* && \
curl -fsSL https://get.pnpm.io/install.sh | env PNPM_VERSION=10.28.1 bash && \
curl -fsSL https://foundry.paradigm.xyz | bash
ENV PATH="$PATH:/root/.local/share/pnpm:/root/.foundry/bin"
RUN foundryup -i v1.5.1
WORKDIR /usr/src/app
COPY . .
ENV NX_DAEMON=false
# cspell:ignore REDISMS
ENV REDISMS_DISABLE_POSTINSTALL=true
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store \
pnpm install --frozen-lockfile
RUN --mount=type=cache,id=nx,target=/usr/src/app/node_modules/.cache/nx \
npx nx run-many -t build -p server mobile --parallel=2
RUN mv dist server/app && \
pnpm deploy --legacy --filter server --prod --ignore-scripts /prod/server
FROM base AS server
# hadolint ignore=DL3008
RUN apt-get update && apt-get install -y dumb-init --no-install-recommends && \
rm -rf /var/lib/apt/lists/* && \
adduser --group --system server
WORKDIR /prod/server
COPY --from=build --chown=server:server /prod/server .
USER server
EXPOSE 3000/tcp
ENTRYPOINT ["dumb-init", "node", "--require=./instrument.cjs", "dist/index.cjs"]