Skip to content

Commit df64f1f

Browse files
author
Gonzalo Diaz
committed
[CONFIG] [Docker] building process re-organized.
1 parent ee73730 commit df64f1f

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/

Dockerfile

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ COPY ./Makefile ${WORKDIR}/
4040
COPY ./.prettierrc ${WORKDIR}/
4141
COPY ./.prettierignore ${WORKDIR}/
4242
COPY ./.eslintrc ${WORKDIR}/
43+
COPY ./.eslintignore ${WORKDIR}/
4344
COPY ./.babelrc ${WORKDIR}/
4445

4546
# markdownlint conf
@@ -65,19 +66,12 @@ RUN npm ci --verbose --ignore-scripts
6566
RUN ls -alh
6667

6768
# CMD []
68-
WORKDIR ${WORKDIR}
6969
###############################################################################
70-
FROM base AS builder
70+
FROM development AS builder
7171

7272
ENV WORKDIR=/app
7373
WORKDIR ${WORKDIR}
7474

75-
COPY ./src ${WORKDIR}/src
76-
COPY ./package.json ${WORKDIR}/package.json
77-
COPY ./package-lock.json ${WORKDIR}/package-lock.json
78-
COPY ./Makefile ${WORKDIR}/
79-
80-
RUN rm -vfr node_modules && npm ci --verbose --omit=dev --ignore-scripts
8175
RUN npm run build
8276

8377
CMD ["ls", "-alh"]
@@ -114,13 +108,12 @@ ENV WORKDIR=/app
114108
WORKDIR ${WORKDIR}
115109

116110
COPY --from=builder /app/dist ${WORKDIR}/dist
117-
COPY --from=builder /app/node_modules ${WORKDIR}/node_modules
118111

119112
COPY ./Makefile ${WORKDIR}/
120113
COPY ./package.json ${WORKDIR}/package.json
121114
COPY ./package-lock.json ${WORKDIR}/package-lock.json
122-
COPY ./Makefile ${WORKDIR}/
123115

116+
RUN npm ci --verbose --omit=dev --omit=optional --ignore-scripts --no-cache
124117
RUN ls -alh
125118

126119
USER node

0 commit comments

Comments
 (0)