-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (33 loc) · 955 Bytes
/
Dockerfile
File metadata and controls
46 lines (33 loc) · 955 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
34
35
36
37
38
39
40
41
42
43
44
45
46
################
## Development ##
################
# base image
FROM node:18 AS development
# Working directory inside container
WORKDIR /src/simulation
# Copy the package.jsons from host to container
# A wildcard is used to ensure both package.json AND package-lock.json are copied
COPY package*.json ./
# Here we install all the deps
RUN npm install
# Bundle app source / copy all other files
COPY . .
# Build the app to the /dist folder
RUN npm run build
################
## PRODUCTION ##
################
# base image
FROM node:18 AS production
# Create app directory
WORKDIR /usr/src/app
# A wildcard is used to ensure both package.json AND package-lock.json are copied
COPY package*.json ./
# Install app dependencies
RUN npm install
# Bundle app source
COPY . .
# Creates a "dist" folder with the production build
RUN npm run build
# Start the server using the production build
CMD [ "node", "--require", "./otlp.js", "dist/main.js" ]