-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (33 loc) · 1005 Bytes
/
Dockerfile
File metadata and controls
44 lines (33 loc) · 1005 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
36
37
38
39
40
41
42
43
44
# Use the official Node.js image from DockerHub
FROM node:20.15.0-slim
# Set the working directory
RUN mkdir -p /app
WORKDIR /app
# Install system dependencies for building native modules
RUN apt-get update && apt-get install -y \
python3 \
make \
g++ \
git \
libc-dev \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
# Install pnpm
RUN npm install -g pnpm
# Copy package.json and pnpm-lock.yaml into the container
COPY package*.json pnpm-lock.yaml* /app/
# Install dependencies (with rebuild fallback for native modules)
RUN pnpm install --frozen-lockfile || pnpm rebuild
# Explicitly rebuild oxc-transform to fix native binding issue
RUN pnpm rebuild oxc-transform || true
# Copy the application files into the container
COPY . /app
# Build the application
RUN pnpm run build
# Expose and set port 8080
EXPOSE 8080
ENV NITRO_PORT=8080
# Set app serving to permissive / assigned
ENV NITRO_HOST=0.0.0.0
# Run the application
ENTRYPOINT ["node", ".output/server/index.mjs"]