-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile.node
More file actions
56 lines (43 loc) · 2.1 KB
/
Copy pathDockerfile.node
File metadata and controls
56 lines (43 loc) · 2.1 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
55
56
FROM node:22-alpine
ARG GH_VERSION=2.99.0
ARG TARGETARCH
# Install git, sudo, Docker tooling, script(1) for browser agent-login PTYs,
# curl, jq, and build tools for native modules (better-sqlite3)
# curl and jq are required for deploy-pr.sh script execution
# docker-cli-compose provides 'docker compose' (v2) command
RUN apk add --no-cache git sudo docker-cli docker-cli-compose curl jq util-linux-misc python3 make g++ \
&& gh_arch="${TARGETARCH:-amd64}" \
&& case "$gh_arch" in amd64|arm64) ;; *) echo "Unsupported GitHub CLI architecture: $gh_arch" >&2; exit 1 ;; esac \
&& gh_archive="gh_${GH_VERSION}_linux_${gh_arch}.tar.gz" \
&& curl -fsSLO "https://github.com/cli/cli/releases/download/v${GH_VERSION}/${gh_archive}" \
&& curl -fsSLO "https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_checksums.txt" \
&& grep " ${gh_archive}$" "gh_${GH_VERSION}_checksums.txt" | sha256sum -c - \
&& tar -xzf "$gh_archive" \
&& install -m 0755 "gh_${GH_VERSION}_linux_${gh_arch}/bin/gh" /usr/local/bin/gh \
&& rm -rf "$gh_archive" "gh_${GH_VERSION}_checksums.txt" "gh_${GH_VERSION}_linux_${gh_arch}" \
&& gh --version
WORKDIR /usr/src/app
# Copy package files (including workspace packages)
COPY package*.json ./
COPY packages/shared/package*.json ./packages/shared/
COPY packages/local-setup/package*.json ./packages/local-setup/
COPY packages/core/package*.json ./packages/core/
COPY packages/api/package*.json ./packages/api/
# Install all dependencies (including dev for TypeScript compilation)
RUN npm install
# Copy application code
COPY . .
# Build shared package first (required for @propr/core imports)
RUN cd packages/shared && npm run build
# Build Node-local shared storage helpers used by the API and CLI.
RUN cd packages/local-setup && npm run build
# Build core package (required for @propr/core imports)
RUN cd packages/core && npm run build
# Build TypeScript (main app)
RUN npm run build
# Create necessary directories
RUN mkdir -p /tmp/git-processor
# Set environment
ENV NODE_ENV=production
# The command will be specified in docker-compose.yml
CMD ["node"]