-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (29 loc) · 930 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
33
34
35
36
37
38
39
40
41
42
# Check out https://hub.docker.com/_/node to select a new base image
FROM node:20.10-bullseye-slim
VOLUME /hostpipe
RUN apt update && apt install -y \
git \
curl \
bash
RUN npm install -g npm@10.8.3
RUN npm install -g @loopback/cli
RUN touch /root/.bashrc | echo "PS1='\w\$ '" >> /root/.bashrc
RUN npm install -g nodemon
RUN npm config set cache /home/node/app/.npm-cache --global
# Set to a non-root built-in user `node`
USER node
RUN mkdir -p /home/node/app
RUN mkdir -p /home/node/app/region
WORKDIR /home/node/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY --chown=node package*.json ./
RUN npm install
# Bundle app source code
COPY --chown=node . .
RUN npm run build
# Bind to all network interfaces so that it can be mapped to the host OS
ENV HOST=0.0.0.0 PORT=3000
EXPOSE ${PORT}
CMD [ "node", "." ]