-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (29 loc) · 890 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
FROM node:16-alpine AS base
# Define how verbose should npm install be
ARG NPM_LOG_LEVEL=silent
# Hide Open Collective message from install logs
ENV OPENCOLLECTIVE_HIDE=1
# Hiden NPM security message from install logs
ENV NPM_CONFIG_AUDIT=false
# Hide NPM funding message from install logs
ENV NPM_CONFIG_FUND=false
# Update npm to version 7
RUN npm i -g npm@8.1.2
# Set the working directory
WORKDIR /app/server
# Copy files specifying dependencies
COPY package.json package-lock.json ./
# Install dependencies
RUN npm ci --loglevel=$NPM_LOG_LEVEL;
# Copy Prisma schema
COPY prisma/schema.prisma ./prisma/
# Generate Prisma client
RUN npm run prisma:generate;
# Copy all the files
COPY . .
# Build code - genearets a dist folder from the contents of the src folder
RUN npm run build
# Expose the port the server listens to
EXPOSE 4000
# Run server
CMD [ "node", "dist/index.js"]