-
Notifications
You must be signed in to change notification settings - Fork 18
/
Dockerfile
32 lines (22 loc) · 934 Bytes
/
Dockerfile
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
# We are using the alpine distribution with Node.js 20 (LTS).
FROM node:20-alpine
# install dependencies to run cmake
RUN apk add --no-cache cmake make gcc g++ python3 libstdc++ libgcc curl bash zeromq zeromq-dev
# Install node-gyp and node-gyp-build globally to avoid issues during build
RUN npm install -g node-gyp node-gyp-build
# Set the working directory inside the container
WORKDIR /dist
# Copy the entire contents of the host's "monorepo" directory into the container's /dist directory
COPY . /dist
# Remove the existing node_modules directory
RUN rm -rf node_modules
# Install dependencies
RUN npm install --build-from-source
# Ensure that the necessary binaries are in the PATH
ENV PATH="/dist/node_modules/.bin:${PATH}"
# Set the working directory to "monorepo/packages/node"
WORKDIR packages/node
# Expose the necessary port
EXPOSE 1031
# Define the command to run when the container starts
CMD ["npm", "start"]