Skip to content
Permalink
Browse files

chore: some more fixes for Docker

  • Loading branch information...
evereq committed Sep 26, 2019
1 parent fc549ce commit 14eff86b6253af6649813a5661715a7991424bc1
Showing with 14 additions and 9 deletions.
  1. +5 −1 .deploy/api/Dockerfile
  2. +9 −8 .deploy/webapp/Dockerfile
@@ -30,6 +30,9 @@ RUN npm install cross-env -g \
&& npm install pm2 -g --unsafe-perm \
&& chmod +x /wait

RUN mkdir /srv/gauzy && chown node:node /srv/gauzy
RUN mkdir /srv/gauzy/dist && chown node:node /srv/gauzy/dist

USER node

WORKDIR /srv/gauzy
@@ -45,4 +48,5 @@ COPY . .

EXPOSE 3000

CMD /wait && cross-env NODE_ENV=production NODE_OPTIONS=--max_old_space_size=2048 yarn ng serve api --host 0.0.0.0 -c=production --prod
CMD /wait \
&& cross-env NODE_ENV=production NODE_OPTIONS=--max_old_space_size=2048 yarn ng serve api --host 0.0.0.0 -c=production --prod
@@ -11,14 +11,12 @@ RUN apk update \
&& npm config set python /usr/bin/python \
&& npm install yarn -g

RUN mkdir /srv/gauzy && chown node:node /srv/gauzy

USER node
RUN mkdir /srv/gauzy

WORKDIR /srv/gauzy

COPY --chown=node:node package.json yarn.lock ./
COPY --chown=node:node apps/api/package.json ./apps/api/package.json
COPY package.json yarn.lock ./
COPY apps/api/package.json ./apps/api/package.json
# COPY .snyk /tmp/.snyk
RUN yarn install

@@ -30,18 +28,21 @@ RUN npm install cross-env -g \
&& npm install pm2 -g --unsafe-perm \
&& chmod +x /wait

USER node
RUN mkdir /srv/gauzy
RUN mkdir /srv/gauzy/dist

WORKDIR /srv/gauzy

ARG NODE_OPTIONS="--max-old-space-size=2048"
ENV NODE_OPTIONS $NODE_OPTIONS
ENV NODE_ENV production

COPY --from=development --chown=root:root /srv/gauzy/node_modules ./node_modules
COPY --from=development /srv/gauzy/node_modules ./node_modules

COPY . .

EXPOSE 4200

CMD /wait && cross-env NODE_ENV=production NODE_OPTIONS=--max_old_space_size=2048 yarn run config:prod && yarn ng serve gauzy --disable-host-check --host 0.0.0.0 -c=production --prod
CMD /wait \
&& cross-env NODE_ENV=production yarn run config:prod \
&& cross-env NODE_ENV=production NODE_OPTIONS=--max_old_space_size=2048 yarn ng serve gauzy --disable-host-check --host 0.0.0.0 -c=production --prod

0 comments on commit 14eff86

Please sign in to comment.
You can’t perform that action at this time.