-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (22 loc) · 800 Bytes
/
Dockerfile
File metadata and controls
31 lines (22 loc) · 800 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
# Use the official lightweight Node.js image, always updated to the latest version.
FROM node:22-alpine3.19
# Set environment variables
ENV NODE_ENV=production
# Install dependencies and tools
RUN apk --no-cache add python3 py3-pip \
&& python3 -m venv /venv \
&& /venv/bin/pip install --no-cache-dir pandas tabulate
# Add virtual environment to the PATH
ENV PATH="/venv/bin:$PATH"
# Set the working directory
WORKDIR /usr/src/app
# Copy only package.json and package-lock.json first to leverage Docker layer caching
COPY package.json package-lock.json ./
# Install Node.js dependencies
RUN npm install --omit=dev
# Copy the rest of the application code
COPY . .
# Build the application
RUN npm run build
# Run the web service on container startup
CMD [ "npm", "run", "start:prod" ]