-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
34 lines (26 loc) · 1001 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
# Use the official lightweight Node.js 16 image.
# https://hub.docker.com/_/node
FROM node:16-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
libsqlite3-dev \
build-essential \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y git
# Create and change to the app directory.
WORKDIR /usr/src/app
# Copy application dependency manifests to the container image.
# A wildcard is used to ensure copying both package.json AND package-lock.json (when available).
# Copying this first prevents re-running npm install on every code change.
COPY package*.json ./
# Install production dependencies.
# If you add a package-lock.json, speed your build by switching to 'npm ci'.
# RUN npm ci --only=production
RUN npm install --only=production --python=/usr/bin/python3
# Copy local code to the container image.
COPY . ./
RUN npm run build
# Run the web service on container startup.
CMD [ "npm", "start" ]