Skip to content

Commit 8a6a136

Browse files
author
Gonzalo Diaz
committed
[BUGFIX] [REFACTOR] [CONFIG] [Docker] lint stage:
- yamllint config needs .gitignore - dependencies must be installed to lint code without bind/mount.
1 parent f8f498a commit 8a6a136

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ COPY ./CODE_OF_CONDUCT.md ${WORKDIR}/
3434
COPY ./src ${WORKDIR}/src
3535
COPY ./package.json ${WORKDIR}/package.json
3636
COPY ./package-lock.json ${WORKDIR}/package-lock.json
37+
COPY ./tsconfig.json ${WORKDIR}/
3738
COPY ./Makefile ${WORKDIR}/
3839

3940
# code linting conf
@@ -48,6 +49,10 @@ COPY ./.markdownlint.yaml ${WORKDIR}/
4849
# yamllint conf
4950
COPY ./.yamllint ${WORKDIR}/
5051
COPY ./.yamlignore ${WORKDIR}/
52+
COPY ./.gitignore ${WORKDIR}/
53+
54+
# Dependencies
55+
RUN npm ci --verbose --ignore-scripts
5156

5257
CMD ["make", "lint"]
5358

@@ -57,14 +62,17 @@ FROM base AS development
5762
ENV WORKDIR=/app
5863
WORKDIR ${WORKDIR}
5964

65+
# Code source
6066
COPY ./src ${WORKDIR}/src
6167
COPY ./package.json ${WORKDIR}/package.json
6268
COPY ./package-lock.json ${WORKDIR}/package-lock.json
6369
COPY ./Makefile ${WORKDIR}/
6470
COPY ./tsconfig.json ${WORKDIR}/tsconfig.json
6571
COPY ./tsconfig.prod.json ${WORKDIR}/tsconfig.prod.json
6672

67-
RUN npm ci --verbose --ignore-scripts
73+
# Dependencies
74+
COPY --from=lint /app/node_modules ${WORKDIR}/node_modules
75+
6876
RUN ls -alh
6977

7078
# CMD []

0 commit comments

Comments
 (0)