2023-01-09 14:08:45 +00:00
|
|
|
###################
|
2023-01-10 07:54:29 +00:00
|
|
|
# BUILD FOR CI TESTING
|
2023-01-09 14:08:45 +00:00
|
|
|
###################
|
|
|
|
|
2024-01-11 15:42:30 +00:00
|
|
|
FROM docker.io/node:18-alpine3.16
|
2023-01-09 14:08:45 +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 . .
|
|
|
|
|
2023-01-10 10:40:48 +00:00
|
|
|
# Generate prisma client
|
2023-01-10 10:35:18 +00:00
|
|
|
RUN npx prisma generate
|
|
|
|
|
2023-01-10 10:40:48 +00:00
|
|
|
# Create a "dist" folder
|
2023-01-09 14:08:45 +00:00
|
|
|
RUN npm run build
|
|
|
|
|
2023-01-10 11:13:37 +00:00
|
|
|
# Run unit tests
|
|
|
|
RUN npm run test:unit:ci
|
|
|
|
|
2023-03-30 08:57:22 +00:00
|
|
|
# ESLint / Prettier
|
|
|
|
RUN npm run lint:check
|
|
|
|
RUN npm run pretty:check
|
|
|
|
|
2023-01-10 10:40:48 +00:00
|
|
|
# Start the server
|
2023-01-10 09:48:15 +00:00
|
|
|
CMD [ "node", "dist/main.js" ]
|