-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (30 loc) · 864 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
FROM node:16-alpine AS base
# Not intended to be verbose
ARG NPM_LOG_LEVEL=silent
# Hide Open Collective message from install logs
ENV OPENCOLLECTIVE_HIDE=1
# Hide 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.10.0
# Set the working directory
WORKDIR /app/server
# Copy files specifying dependencies
COPY package.json ./
COPY package-lock.json ./
# Install dependencies
RUN npm install;
# 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"]