forked from thoth-tech/doubtfire-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (20 loc) · 660 Bytes
/
Dockerfile
File metadata and controls
30 lines (20 loc) · 660 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
FROM node:20
ENV DEBIAN_FRONTEND noninteractive
ENV USER=node
ENV NODE_ENV docker
# You can not use `${USER}` here, but reference `/home/node`.
ENV PATH="/home/node/.npm-global/bin:${PATH}"
# 👉 The `--global` install dir
ENV NPM_CONFIG_PREFIX="/home/node/.npm-global"
EXPOSE 4200
USER "${USER}"
# Pre-create the target dir for global install.
RUN mkdir -p "${NPM_CONFIG_PREFIX}/lib"
WORKDIR /doubtfire-web
# Copy in resources
COPY --chown="${USER}":root . .
# Setup within container
RUN npm ci --force --include=optional
EXPOSE 9876
# Launch - install on launch so that node_modules are updated in volume
CMD /bin/bash -c 'npm install; npm start'