-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (31 loc) · 1.12 KB
/
Dockerfile
File metadata and controls
38 lines (31 loc) · 1.12 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
# Multi-stage build using Node 25.2.1
FROM node:25.2.1 AS builder
WORKDIR /app
# Install dependencies (including devDeps for build)
COPY package.json package-lock.json* ./
RUN npm install
# Copy sources and build (client + server)
COPY . .
RUN npm run build
########################################
# Production image
FROM node:25.2.1-slim AS runner
WORKDIR /app
ENV NODE_ENV=production
# Install Arduino CLI and required tools
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates tar xz-utils g++ \
&& curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=/usr/local/bin sh \
&& arduino-cli config init \
&& arduino-cli core update-index \
&& arduino-cli core install arduino:avr \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Copy built artifacts
COPY --from=builder /app/dist ./dist
# Copy package metadata and install all dependencies
# (vite is marked as external in esbuild but needed at runtime for middleware mode)
COPY package.json package-lock.json* ./
RUN npm install --legacy-peer-deps --production=false
EXPOSE 3000
CMD ["npm", "run", "start"]