adjust docker file to enable better build flow for tests
This commit is contained in:
parent
700353cff4
commit
96189c2392
@ -2,13 +2,13 @@ FROM node:alpine as files
|
|||||||
ENV TZ="Europe/Berlin"
|
ENV TZ="Europe/Berlin"
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY [ "package-lock.json", "package.json", "index.ts", "tsconfig.json", "./" ]
|
COPY [ "package-lock.json", "package.json", "index.ts", "tsconfig.json", "./" ]
|
||||||
COPY server ./server
|
|
||||||
|
|
||||||
FROM files as proddependencies
|
FROM files as proddependencies
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
RUN npm ci --omit=dev
|
RUN npm ci --omit=dev
|
||||||
|
|
||||||
FROM proddependencies as compile
|
FROM proddependencies as compile
|
||||||
|
COPY server ./server
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
CMD ["npm","run","start"]
|
CMD ["npm","run","start"]
|
||||||
|
|
||||||
@ -16,6 +16,7 @@ FROM files as dependencies
|
|||||||
RUN npm ci
|
RUN npm ci
|
||||||
|
|
||||||
FROM dependencies as test
|
FROM dependencies as test
|
||||||
|
COPY server ./server
|
||||||
COPY jest.config.js .
|
COPY jest.config.js .
|
||||||
COPY tests ./tests
|
COPY tests ./tests
|
||||||
RUN npm run test
|
RUN npm run test
|
||||||
|
Loading…
Reference in New Issue
Block a user