2023-04-06 09:12:49 +00:00
|
|
|
###################
|
|
|
|
# BUILD FOR CI TESTING
|
|
|
|
###################
|
|
|
|
|
2024-01-22 15:57:44 +00:00
|
|
|
FROM docker.io/node:lts-hydrogen
|
2023-04-06 09:12:49 +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
|
|
|
|
|
|
|
|
# ESLint / Prettier
|
|
|
|
RUN npm run lint:check
|
|
|
|
RUN npm run pretty:check
|
|
|
|
|
|
|
|
# Start the server
|
|
|
|
CMD [ "node", "dist/main.js" ]
|