-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (25 loc) · 749 Bytes
/
Dockerfile
File metadata and controls
35 lines (25 loc) · 749 Bytes
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
# Use an official Node runtime as the base image
FROM --platform=linux/amd64 node:18
# Install Python and other dependencies
RUN apt-get update && \
apt-get install -y python3 make g++ && \
apt-get clean
# install pnpm
RUN npm install -g pnpm
# Set environment variables
ENV npm_config_target_arch=arm64
# Set working directory
WORKDIR /app
# Install dependencies first (this layer will be cached)
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
# Copy over tsconfig.json and any other build-related files
COPY tsconfig.json ./
# Copy the current directory contents into the container
COPY . .
# Build the application
RUN pnpm run build
# Expose port
EXPOSE 3000
# Start the app
CMD ["pnpm", "run", "start"]