Skip to content

Commit

Permalink
fix(lint): docker files
Browse files Browse the repository at this point in the history
  • Loading branch information
hongbo-miao committed Jun 19, 2021
1 parent f19c18a commit d6c3a9c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
9 changes: 3 additions & 6 deletions Dockerfile.prometheus.test
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
FROM prom/prometheus:v2.27.1
WORKDIR /usr/src/app

WORKDIR /app

COPY docker/prometheus/alerting-rules.yml .
COPY docker/prometheus/alerting-rules.test.yml .

RUN promtool test rules *.test.yml
COPY ["docker/prometheus/*.yml", "./"]
RUN promtool test rules ./*.test.yml
12 changes: 6 additions & 6 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ RUN npm ci

COPY web ./
# Skip lint check during react-scripts build
RUN rm -f ./.eslintrc.js
RUN npm run build
RUN npm prune --production
RUN rm -f ./.eslintrc.js \
&& npm run build \
&& npm prune --production


FROM base AS api
COPY ["api/package.json", "api/package-lock.json", "./"]
RUN npm ci
COPY api ./
RUN npm run build
RUN npm prune --production
RUN npm run build \
&& npm prune --production


FROM base AS release
RUN apk add dumb-init
RUN apk add --no-cache dumb-init=1.2.5-r1
ENV NODE_ENV production
USER node

Expand Down
5 changes: 2 additions & 3 deletions api/Dockerfile.development
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ RUN npm ci
COPY web/.env.production.local.example ./.env.production.local
COPY web ./
# Skip lint check during react-scripts build
RUN rm -f ./.eslintrc.js
RUN npm run build
RUN rm -f ./.eslintrc.js \
&& npm run build


FROM base AS api
Expand All @@ -22,6 +22,5 @@ RUN npm ci
COPY --from=web /usr/src/app/build ./public
COPY api ./

WORKDIR /usr/src/app/api
EXPOSE 5000
CMD ["npm", "run", "dev"]
4 changes: 2 additions & 2 deletions web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ COPY ["web/package.json", "web/package-lock.json", "./"]
RUN npm ci
COPY web/ ./
# Skip lint check during react-scripts build
RUN rm -f ./.eslintrc.js
RUN npm run build
RUN rm -f ./.eslintrc.js \
&& npm run build


FROM nginx:1.21.0-alpine AS release
Expand Down

0 comments on commit d6c3a9c

Please sign in to comment.