Skip to content

Commit

Permalink
fix(container): build nodes in production env
Browse files Browse the repository at this point in the history
  • Loading branch information
alimd committed Dec 20, 2022
1 parent c0bff25 commit 2f0c3bc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
8 changes: 5 additions & 3 deletions cloud/container/alwatr-pwa.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@ FROM docker.io/library/node:${NODE_VERSION}-alpine as builder

WORKDIR /app

ENV NODE_ENV production

# Install dependencies
COPY package.json *.lock ./
RUN if [ -f *.lock ]; then \
yarn install --frozen-lockfile --non-interactive; \
yarn install --frozen-lockfile --non-interactive --production false;; \
else \
yarn install --non-interactive; \
yarn install --non-interactive --production false;; \
fi;

COPY . .

# Reinstall to link internal packages
RUN yarn install --frozen-lockfile --non-interactive;
RUN yarn install --frozen-lockfile --non-interactive --production false;;

# Build all ts files
RUN yarn build:ts;
Expand Down
12 changes: 7 additions & 5 deletions cloud/container/alwatr-services.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,23 @@ FROM docker.io/library/node:${NODE_VERSION}-alpine as builder

WORKDIR /app

ENV NODE_ENV production

# Install dependencies
COPY package.json *.lock ./
RUN if [ -f *.lock ]; then \
yarn install --frozen-lockfile --non-interactive; \
yarn install --frozen-lockfile --non-interactive --production false; \
else \
yarn install --non-interactive; \
yarn install --non-interactive --production false; \
fi;

COPY . .

# Reinstall to link internal packages
RUN yarn install --frozen-lockfile --non-interactive;
RUN yarn install --frozen-lockfile --non-interactive --production false;

# Build all ts files
RUN yarn build:ts;
RUN yarn build:ts;

# Build target package
ARG PACKAGE_SOURCE
Expand All @@ -36,7 +38,7 @@ RUN set -ex;\
RUN set -ex;\
pwd;\
rm -rf node_modules;\
yarn install --frozen-lockfile --non-interactive --production;
yarn install --frozen-lockfile --non-interactive --production true;

# ---

Expand Down

0 comments on commit 2f0c3bc

Please sign in to comment.