-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (27 loc) · 774 Bytes
/
Dockerfile
File metadata and controls
33 lines (27 loc) · 774 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
# syntax=docker/dockerfile:1
FROM node:18-alpine AS builder
ARG REVISION=master
RUN wget https://github.com/mountebank-testing/mountebank/archive/${REVISION}.zip -O mb.zip
RUN unzip mb.zip
RUN mv mountebank* /mountebank
WORKDIR /mountebank
# Validate versions
RUN node -v && npm -v
# Install Dependencies
RUN npm ci
# Version
RUN node tasks/version.js
RUN npm run jsdoc
# Dist
RUN node tasks/dist.js
FROM node:18-alpine
WORKDIR /app
# Install tarball to allow the command to be 'mb' instead of 'bin/mb'
COPY --from=builder /mountebank/dist/mountebank/mountebank-*.tgz ./
RUN npm install --production -g mountebank-*.tgz && npm cache clean -f
# Run as a non-root user
RUN adduser -D mountebank
RUN chown -R mountebank /app
USER mountebank
EXPOSE 2525
ENTRYPOINT ["mb"]