-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathDockerfile
38 lines (29 loc) · 1.02 KB
/
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
33
34
35
36
37
38
FROM mongo:7.0.14
# Install app dependencies
RUN mkdir -p /source
WORKDIR /source
ENV HOME=/root
ENV NVM_DIR=$HOME/.nvm
RUN apt update -y && apt install -y curl unzip && \
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash && \
chmod +x $NVM_DIR/nvm.sh && \
. $NVM_DIR/nvm.sh && \
nvm install 22.10.0 && \
nvm alias default 22.10.0 && \
nvm use 22.10.0
ENV PATH=/root/.nvm/versions/node/v22.10.0/bin:$NVM_DIR:$PATH
ADD packages /source/
ADD package* /source/
ADD examples/kitchensink/package* /source/examples/kitchensink/
ADD examples/minimal/package* /source/examples/minimal/
ADD jest-mongodb-config.cjs /source/jest-mongodb-config.cjs
ENV MONGOMS_VERSION=7.0.14
ENV MONGOMS_SYSTEM_BINARY=/usr/bin/mongod
ENV NODE_NO_WARNINGS=1
RUN NODE_ENV=development npm install -ws --include-workspace-root
ADD . /source/
# Without the double build, unit tests fail?
RUN npm run build || :
RUN npm run build || :
RUN cd examples/kitchensink && npm install && npm run build || :
CMD ["npm"]