2023-11-16 09:22:18 +00:00
|
|
|
ARG NODE_VERSION=20.9.0
|
|
|
|
|
2023-01-10 14:28:19 +00:00
|
|
|
###################
|
|
|
|
# BUILD FOR CI TESTING
|
|
|
|
###################
|
|
|
|
|
2024-01-11 15:48:16 +00:00
|
|
|
FROM docker.io/node:${NODE_VERSION}
|
2023-01-10 14:28:19 +00:00
|
|
|
|
|
|
|
# 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 ci
|
|
|
|
|
|
|
|
# Bundle app source
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
# Generate prisma client
|
|
|
|
RUN npx prisma generate
|
|
|
|
|
|
|
|
# Create a "dist" folder
|
|
|
|
RUN npm run build
|
|
|
|
|
|
|
|
# Run unit tests
|
|
|
|
RUN npm run test:unit:ci
|
|
|
|
|
2023-03-30 08:28:20 +00:00
|
|
|
# ESLint / Prettier
|
|
|
|
RUN npm run lint:check
|
|
|
|
RUN npm run pretty:check
|
|
|
|
|
2023-03-30 08:32:17 +00:00
|
|
|
# Start the server
|
|
|
|
CMD [ "node", "dist/main.js" ]
|